aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/buffer.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 7ba58386beee..98196327ddf0 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2564,14 +2564,13 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
2564 struct inode *inode = page->mapping->host; 2564 struct inode *inode = page->mapping->host;
2565 struct buffer_head *head = fsdata; 2565 struct buffer_head *head = fsdata;
2566 struct buffer_head *bh; 2566 struct buffer_head *bh;
2567 BUG_ON(fsdata != NULL && page_has_buffers(page));
2567 2568
2568 if (!PageMappedToDisk(page)) { 2569 if (unlikely(copied < len) && !page_has_buffers(page))
2569 if (unlikely(copied < len) && !page_has_buffers(page)) 2570 attach_nobh_buffers(page, head);
2570 attach_nobh_buffers(page, head); 2571 if (page_has_buffers(page))
2571 if (page_has_buffers(page)) 2572 return generic_write_end(file, mapping, pos, len,
2572 return generic_write_end(file, mapping, pos, len, 2573 copied, page, fsdata);
2573 copied, page, fsdata);
2574 }
2575 2574
2576 SetPageUptodate(page); 2575 SetPageUptodate(page);
2577 set_page_dirty(page); 2576 set_page_dirty(page);