f2fs: do not update REQ_TIME in case of error conditions
authorSahitya Tummala <stummala@codeaurora.org>
Fri, 5 Oct 2018 05:17:39 +0000 (10:47 +0530)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 26 Oct 2018 18:26:44 +0000 (11:26 -0700)
The REQ_TIME should be updated only in case of success cases
as followed at all other places in the file system.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/dir.c
fs/f2fs/file.c

index c77a58038709dbf0b5347a2a551aadce700942eb..e02db5db62dc2a78263beae0979efae8168ea1a3 100644 (file)
@@ -655,9 +655,9 @@ int f2fs_do_tmpfile(struct inode *inode, struct inode *dir)
        f2fs_put_page(page, 1);
 
        clear_inode_flag(inode, FI_NEW_INODE);
+       f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
 fail:
        up_write(&F2FS_I(inode)->i_sem);
-       f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
        return err;
 }
 
index 44a5e564609e8d38c933414233df40b0cd14a839..be973e6d1a99d84d6c884b68a9a8be8b30cde29e 100644 (file)
@@ -106,6 +106,7 @@ static int f2fs_vm_page_mkwrite(struct vm_fault *vmf)
                SetPageUptodate(page);
 
        f2fs_update_iostat(sbi, APP_MAPPED_IO, F2FS_BLKSIZE);
+       f2fs_update_time(sbi, REQ_TIME);
 
        trace_f2fs_vm_page_mkwrite(page, DATA);
 out_sem:
@@ -114,7 +115,6 @@ out_sem:
        f2fs_balance_fs(sbi, dn.node_changed);
 
        sb_end_pagefault(inode->i_sb);
-       f2fs_update_time(sbi, REQ_TIME);
 err:
        return block_page_mkwrite_return(err);
 }