Skip to content

Commit

Permalink
fs: buffer don't PageUptodate without page locked
Browse files Browse the repository at this point in the history
__block_write_full_page is calling SetPageUptodate without the page locked.
This is unusual, but not incorrect, as PG_writeback is still set.

However the next patch will require that SetPageUptodate always be called with
the page locked.  Simply don't bother setting the page uptodate in this case
(it is unusual 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 <[email protected]>
Cc: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed May 7, 2007
1 parent 6fe6900 commit 3d67f2d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,17 +1700,8 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
* 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.
Expand Down

0 comments on commit 3d67f2d

Please sign in to comment.