Re: [patch 2/3] fs: buffer don't PageUptodate without page locked

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Linus Torvalds <torvalds@...>, Hugh Dickins <hugh@...>, Linux Kernel <linux-kernel@...>, Linux Memory Management <linux-mm@...>, Linux Filesystems <linux-fsdevel@...>
Date: Tuesday, February 6, 2007 - 4:31 am

On Tue, Feb 06, 2007 at 12:21:40AM -0800, Andrew Morton wrote:

Hmm, it definitely shouldn't be there, it leaked in from another patch
to bring partiy with the error handling...

Here is an updated patch.

--

__block_write_full_page is calling SetPageUptodate without the page locked.
This is unusual, but not incorrect, as PG_writeback is still set.

However with the previous patch, this is now a problem: so don't bother
setting the page uptodate in this case (it is weird that the write path
does such a thing anyway). Instead just leave it to the read side to bring
the page uptodate when it notices that all buffers are uptodate.

Signed-off-by: Nick Piggin <npiggin@suse.de>

Index: linux-2.6/fs/buffer.c
===================================================================
--- linux-2.6.orig/fs/buffer.c
+++ linux-2.6/fs/buffer.c
@@ -1698,17 +1698,8 @@ done:
 		 * clean.  Someone wrote them back by hand with
 		 * ll_rw_block/submit_bh.  A rare case.
 		 */
-		int uptodate = 1;
-		do {
-			if (!buffer_uptodate(bh)) {
-				uptodate = 0;
-				break;
-			}
-			bh = bh->b_this_page;
-		} while (bh != head);
-		if (uptodate)
-			SetPageUptodate(page);
 		end_page_writeback(page);
+
 		/*
 		 * The page and buffer_heads can be released at any time from
 		 * here on.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 3/3] mm: make read_cache_page synchronous, Nick Piggin, (Tue Feb 6, 4:02 am)
Re: [patch 3/3] mm: make read_cache_page synchronous, Andrew Morton, (Tue Feb 6, 4:28 am)
Re: [patch 3/3] mm: make read_cache_page synchronous, Nick Piggin, (Tue Feb 6, 4:58 am)
Re: [patch 3/3] mm: make read_cache_page synchronous, Nick Piggin, (Tue Feb 6, 4:56 am)
[patch 1/3] mm: fix PageUptodate memorder, Nick Piggin, (Tue Feb 6, 4:02 am)
Re: [patch 1/3] mm: fix PageUptodate memorder, Andrew Morton, (Tue Feb 6, 4:25 am)
Re: [patch 1/3] mm: fix PageUptodate memorder, Nick Piggin, (Tue Feb 6, 4:51 am)
Re: [patch 2/3] fs: buffer don't PageUptodate without page l..., Nick Piggin, (Tue Feb 6, 4:31 am)