f2fs: atomic: fix to truncate pagecache before on-disk metadata truncation
[ Upstream commit ebd3309aec6271c4616573b0cb83ea25e623070a ] We should always truncate pagecache while truncating on-disk data. Fixes: a46bebd502fe ("f2fs: synchronize atomic write aborts") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
25c5d480d2
commit
b094fedb26
@ -2171,6 +2171,10 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
|
||||
clear_inode_flag(fi->cow_inode, FI_INLINE_DATA);
|
||||
} else {
|
||||
/* Reuse the already created COW inode */
|
||||
f2fs_bug_on(sbi, get_dirty_pages(fi->cow_inode));
|
||||
|
||||
invalidate_mapping_pages(fi->cow_inode->i_mapping, 0, -1);
|
||||
|
||||
ret = f2fs_do_truncate_blocks(fi->cow_inode, 0, true);
|
||||
if (ret) {
|
||||
f2fs_up_write(&fi->i_gc_rwsem[WRITE]);
|
||||
|
Loading…
Reference in New Issue
Block a user