Commit d7b8b384 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: fix leakage of inmemory atomic pages

If we got failure during commit_atomic_write, abort_volatile_write will be
called, but will not drop the inmemory pages due to no FI_ATOMIC_FILE.
Actually, there is no reason to check the flag in abort_volatile_write.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent f96999c3
...@@ -1443,13 +1443,9 @@ static int f2fs_ioc_abort_volatile_write(struct file *filp) ...@@ -1443,13 +1443,9 @@ static int f2fs_ioc_abort_volatile_write(struct file *filp)
f2fs_balance_fs(F2FS_I_SB(inode)); f2fs_balance_fs(F2FS_I_SB(inode));
if (f2fs_is_atomic_file(inode)) { clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE);
clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); clear_inode_flag(F2FS_I(inode), FI_VOLATILE_FILE);
commit_inmem_pages(inode, true); commit_inmem_pages(inode, true);
}
if (f2fs_is_volatile_file(inode))
clear_inode_flag(F2FS_I(inode), FI_VOLATILE_FILE);
mnt_drop_write_file(filp); mnt_drop_write_file(filp);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment