f2fs: fix to avoid tagging SBI_QUOTA_NEED_REPAIR incorrectly
authorChao Yu <yuchao0@huawei.com>
Fri, 19 Jul 2019 03:51:11 +0000 (11:51 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 23 Aug 2019 14:57:11 +0000 (07:57 -0700)
On a quota disabled image, with fault injection, SBI_QUOTA_NEED_REPAIR
will be set incorrectly in error path of f2fs_evict_inode(), fix it.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/inode.c

index a33d7a849b2df8efd97d4684017b770070ed2858..d1998ddf14fde5cc1500d5a9b6cf5d9c815cf65e 100644 (file)
@@ -693,7 +693,8 @@ retry:
 
        if (err) {
                f2fs_update_inode_page(inode);
-               set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
+               if (dquot_initialize_needed(inode))
+                       set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
        }
        sb_end_intwrite(inode->i_sb);
 no_delete: