aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r--fs/nilfs2/inode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 6252b173a465..d071e7f23de2 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -24,6 +24,7 @@
24#include <linux/buffer_head.h> 24#include <linux/buffer_head.h>
25#include <linux/gfp.h> 25#include <linux/gfp.h>
26#include <linux/mpage.h> 26#include <linux/mpage.h>
27#include <linux/pagemap.h>
27#include <linux/writeback.h> 28#include <linux/writeback.h>
28#include <linux/aio.h> 29#include <linux/aio.h>
29#include "nilfs.h" 30#include "nilfs.h"
@@ -219,10 +220,10 @@ static int nilfs_writepage(struct page *page, struct writeback_control *wbc)
219 220
220static int nilfs_set_page_dirty(struct page *page) 221static int nilfs_set_page_dirty(struct page *page)
221{ 222{
223 struct inode *inode = page->mapping->host;
222 int ret = __set_page_dirty_nobuffers(page); 224 int ret = __set_page_dirty_nobuffers(page);
223 225
224 if (page_has_buffers(page)) { 226 if (page_has_buffers(page)) {
225 struct inode *inode = page->mapping->host;
226 unsigned nr_dirty = 0; 227 unsigned nr_dirty = 0;
227 struct buffer_head *bh, *head; 228 struct buffer_head *bh, *head;
228 229
@@ -245,6 +246,10 @@ static int nilfs_set_page_dirty(struct page *page)
245 246
246 if (nr_dirty) 247 if (nr_dirty)
247 nilfs_set_file_dirty(inode, nr_dirty); 248 nilfs_set_file_dirty(inode, nr_dirty);
249 } else if (ret) {
250 unsigned nr_dirty = 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits);
251
252 nilfs_set_file_dirty(inode, nr_dirty);
248 } 253 }
249 return ret; 254 return ret;
250} 255}