diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2017-03-18 09:20:55 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-03-21 22:34:36 -0400 |
commit | 684ca7e55de1f3defb13c491e0b5eb8f27ffe79c (patch) | |
tree | 4ec04c19a2774f821549a7b14964802151f09627 /fs/f2fs | |
parent | a58f24495d072c5cf2177a5343dd8d751383fdc7 (diff) | |
download | talos-op-linux-684ca7e55de1f3defb13c491e0b5eb8f27ffe79c.tar.gz talos-op-linux-684ca7e55de1f3defb13c491e0b5eb8f27ffe79c.zip |
f2fs: avoid stat_inc_atomic_write for non-atomic file
After filemap_write_and_wait_range fail, the FI_ATOMIC_FILE flags is removed,
so that f2fs should not increase the stat of atomic_write.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/file.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 78ece6e4779c..7704bd99b990 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1533,17 +1533,21 @@ static int f2fs_ioc_start_atomic_write(struct file *filp) f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); if (!get_dirty_pages(inode)) - goto out; + goto inc_stat; f2fs_msg(F2FS_I_SB(inode)->sb, KERN_WARNING, "Unexpected flush for atomic writes: ino=%lu, npages=%u", inode->i_ino, get_dirty_pages(inode)); ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); - if (ret) + if (ret) { clear_inode_flag(inode, FI_ATOMIC_FILE); -out: + goto out; + } + +inc_stat: stat_inc_atomic_write(inode); stat_update_max_atomic_write(inode); +out: inode_unlock(inode); mnt_drop_write_file(filp); return ret; |