Commit edb46ddb authored by Kemeng Shi's avatar Kemeng Shi Committed by Jan Kara

quota: remove unnecessary error code translation in dquot_quota_enable

Simply set error code to -EEXIST when quota limit is already enabled in
dquot_quota_enable to remove unnecessary error code translation.

Link: https://patch.msgid.link/20240715130534.2112678-5-shikemeng@huaweicloud.comSigned-off-by: default avatarKemeng Shi <shikemeng@huaweicloud.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent f439111b
......@@ -2594,7 +2594,8 @@ static int dquot_quota_enable(struct super_block *sb, unsigned int flags)
goto out_err;
}
if (sb_has_quota_limits_enabled(sb, type)) {
ret = -EBUSY;
/* compatible with XFS */
ret = -EEXIST;
goto out_err;
}
spin_lock(&dq_state_lock);
......@@ -2608,9 +2609,6 @@ static int dquot_quota_enable(struct super_block *sb, unsigned int flags)
if (flags & qtype_enforce_flag(type))
dquot_disable(sb, type, DQUOT_LIMITS_ENABLED);
}
/* Error code translation for better compatibility with XFS */
if (ret == -EBUSY)
ret = -EEXIST;
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment