diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-08-18 23:37:36 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-08-29 10:02:56 -0700 |
commit | 84a23fbe96b4e307eb749046a74515329119b08d (patch) | |
tree | 8890e38b3437b75d4e3a24c3146abe07e85592ef /fs/f2fs/file.c | |
parent | 6f890df0a7efe3181aceb5d8bcd4af7deb2abce5 (diff) | |
download | linux-stable-84a23fbe96b4e307eb749046a74515329119b08d.tar.gz linux-stable-84a23fbe96b4e307eb749046a74515329119b08d.tar.bz2 linux-stable-84a23fbe96b4e307eb749046a74515329119b08d.zip |
f2fs: clear FI_HOT_DATA correctly
This patch fixes to clear FI_HOT_DATA correctly in below path:
- error handling in f2fs_ioc_start_atomic_write
- after commit atomic write in f2fs_ioc_commit_atomic_write
- after drop atomic write in drop_inmem_pages
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 3eebd49c3348..8f0d32a57b52 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1640,6 +1640,7 @@ static int f2fs_ioc_start_atomic_write(struct file *filp) ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); if (ret) { clear_inode_flag(inode, FI_ATOMIC_FILE); + clear_inode_flag(inode, FI_HOT_DATA); goto out; } @@ -1678,6 +1679,7 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp) ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true); if (!ret) { clear_inode_flag(inode, FI_ATOMIC_FILE); + clear_inode_flag(inode, FI_HOT_DATA); stat_dec_atomic_write(inode); } } else { |