diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-10-21 18:49:50 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-10-21 19:04:17 -0700 |
commit | d7b8b384b02f52b20a538e741c75c5d50c0e131f (patch) | |
tree | bb27b2de1a0f5986335837f997b7b020bf61e39a /fs/f2fs | |
parent | f96999c35f46fa9bce8a3a2812cd0a28fcde5903 (diff) |
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: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/file.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 91c51a6d42dd..a197215ad52b 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1443,13 +1443,9 @@ static int f2fs_ioc_abort_volatile_write(struct file *filp) f2fs_balance_fs(F2FS_I_SB(inode)); - if (f2fs_is_atomic_file(inode)) { - clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); - commit_inmem_pages(inode, true); - } - - if (f2fs_is_volatile_file(inode)) - clear_inode_flag(F2FS_I(inode), FI_VOLATILE_FILE); + clear_inode_flag(F2FS_I(inode), FI_ATOMIC_FILE); + clear_inode_flag(F2FS_I(inode), FI_VOLATILE_FILE); + commit_inmem_pages(inode, true); mnt_drop_write_file(filp); return ret; |