aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-02-20 16:57:54 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-20 20:10:13 -0500
commitffda9d302267dbb7fc9bc38f6e4c1b3d61a536a9 (patch)
treed3b95c0b7dc2edc602e71e2ff8389de79ea243ac
parentbc56bba8f31bd99f350a5ebfd43d50f411b620c7 (diff)
[PATCH] fs: fix __block_write_full_page error case buffer submission
Andrew noticed that unlocking the page before submitting all buffers for writeout could cause problems if the IO completes before we've finished messing around with the page buffers, and they subsequently get freed. Even if there were no bug, it is a good idea to bring the error case into line with the common case here. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index f99c509697cd..e95fe4f8d11a 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1743,7 +1743,6 @@ recover:
1743 SetPageError(page); 1743 SetPageError(page);
1744 BUG_ON(PageWriteback(page)); 1744 BUG_ON(PageWriteback(page));
1745 set_page_writeback(page); 1745 set_page_writeback(page);
1746 unlock_page(page);
1747 do { 1746 do {
1748 struct buffer_head *next = bh->b_this_page; 1747 struct buffer_head *next = bh->b_this_page;
1749 if (buffer_async_write(bh)) { 1748 if (buffer_async_write(bh)) {
@@ -1753,6 +1752,7 @@ recover:
1753 } 1752 }
1754 bh = next; 1753 bh = next;
1755 } while (bh != head); 1754 } while (bh != head);
1755 unlock_page(page);
1756 goto done; 1756 goto done;
1757} 1757}
1758 1758