diff options
author | Kemeng Shi <shikemeng@huaweicloud.com> | 2024-07-15 21:05:34 +0800 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2024-07-22 18:13:56 +0200 |
commit | edb46ddbc55e53eef3d6e575087baa315598d253 (patch) | |
tree | f56c3f61ec0562cc1a71f74c29bfd3092d5bdc34 /fs/quota | |
parent | f439111b489167dce14ade4e848be8a1b23283ff (diff) | |
download | linux-edb46ddbc55e53eef3d6e575087baa315598d253.tar.gz linux-edb46ddbc55e53eef3d6e575087baa315598d253.tar.bz2 linux-edb46ddbc55e53eef3d6e575087baa315598d253.zip |
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.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota')
-rw-r--r-- | fs/quota/dquot.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 156bdd570ef6..30496367d581 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -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 @@ out_err: 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; } |