提交 6b7021ef 编写于 作者: J Jan Kara 提交者: Linus Torvalds

ext2: also update the inode on disk when dir is IS_DIRSYNC

We used to just write changed page for IS_DIRSYNC inodes.  But we also
have to update the directory inode itself just for the case that we've
allocated a new block and changed i_size.

[akpm@linux-foundation.org: still sync the data page]
Signed-off-by: NJan Kara <jack@suse.cz>
Tested-by: NPavel Machek <pavel@suse.cz>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 634a84f8
...@@ -95,10 +95,13 @@ static int ext2_commit_chunk(struct page *page, loff_t pos, unsigned len) ...@@ -95,10 +95,13 @@ static int ext2_commit_chunk(struct page *page, loff_t pos, unsigned len)
mark_inode_dirty(dir); mark_inode_dirty(dir);
} }
if (IS_DIRSYNC(dir)) if (IS_DIRSYNC(dir)) {
err = write_one_page(page, 1); err = write_one_page(page, 1);
else if (!err)
err = ext2_sync_inode(dir);
} else {
unlock_page(page); unlock_page(page);
}
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册