Skip to contentSkip to conversation

f2fs: fix to avoid tagging SBI_QUOTA_NEED_REPAIR incorrectly

PATCH New Chao Yu 1 participant 1 message Jul 19, 2019 F2FS file system

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 f2fs: fix to avoid tagging SBI_QUOTA_NEED_REPAIR incorrectly

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.

---
 fs/f2fs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/inode.c +2 -1
index a33d7a849b2d..d1998ddf14fd 100644
@@ -693,7 +693,8 @@ void f2fs_evict_inode(struct inode *inode)
 
 	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:
Signature · 1 line
2.18.0.rc1