diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index d41081aae2e55..ca11bbb1500ff 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2705,7 +2705,8 @@ int f2fs_quota_sync(struct super_block *sb, int type) if (!sb_has_quota_active(sb, cnt)) continue; - inode_lock(dqopt->files[cnt]); + if (!f2fs_sb_has_quota_ino(sbi)) + inode_lock(dqopt->files[cnt]); /* * do_quotactl @@ -2724,7 +2725,8 @@ int f2fs_quota_sync(struct super_block *sb, int type) up_read(&sbi->quota_sem); f2fs_unlock_op(sbi); - inode_unlock(dqopt->files[cnt]); + if (!f2fs_sb_has_quota_ino(sbi)) + inode_unlock(dqopt->files[cnt]); if (ret) break;