Skip to content

Commit

Permalink
nobh: nobh_write_end fix
Browse files Browse the repository at this point in the history
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 03158cd ("fs: restore nobh")
introcduced a NULL deref.  Spotted by the Coverity checker.

Signed-off-by: Nick Piggin <[email protected]>
Cc: Badari Pulavarty <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Oct 21, 2007
1 parent cfa76f0 commit efdc313
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,7 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
struct page *page, void *fsdata)
{
struct inode *inode = page->mapping->host;
struct buffer_head *head = NULL;
struct buffer_head *head = fsdata;
struct buffer_head *bh;

if (!PageMappedToDisk(page)) {
Expand All @@ -2584,7 +2584,6 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
unlock_page(page);
page_cache_release(page);

head = fsdata;
while (head) {
bh = head;
head = head->b_this_page;
Expand Down

0 comments on commit efdc313

Please sign in to comment.