aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-10-21 00:57:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-21 11:54:05 -0400
commitefdc31319d43050a5742fb690b1a4beb68092a94 (patch)
tree697e9db6db5675c46d559d8982e34a1f8df4f3d1 /fs
parentcfa76f024f7c9e65169425804e5b32e71f66d0ee (diff)
nobh: nobh_write_end fix
This path mustn't have been tested :( I did attempt to exercise it by injecting failures here, but I suspect PageMappedToDisk may have been getting in the way. Will need more of a look, although I think nobh mode is OK for an -rc1 (it shouldn't eat anyone's data). Commit 03158cd7eb3374843de68421142ca5900df845d9 ("fs: restore nobh") introcduced a NULL deref. Spotted by the Coverity checker. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Badari Pulavarty <pbadari@us.ibm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/buffer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 76403b1764c5..7249e014819e 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2563,7 +2563,7 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
2563 struct page *page, void *fsdata) 2563 struct page *page, void *fsdata)
2564{ 2564{
2565 struct inode *inode = page->mapping->host; 2565 struct inode *inode = page->mapping->host;
2566 struct buffer_head *head = NULL; 2566 struct buffer_head *head = fsdata;
2567 struct buffer_head *bh; 2567 struct buffer_head *bh;
2568 2568
2569 if (!PageMappedToDisk(page)) { 2569 if (!PageMappedToDisk(page)) {
@@ -2584,7 +2584,6 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
2584 unlock_page(page); 2584 unlock_page(page);
2585 page_cache_release(page); 2585 page_cache_release(page);
2586 2586
2587 head = fsdata;
2588 while (head) { 2587 while (head) {
2589 bh = head; 2588 bh = head;
2590 head = head->b_this_page; 2589 head = head->b_this_page;