Skip to content

Commit edb46dd

Browse files
Kemeng Shijankara
authored andcommitted
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/[email protected] Signed-off-by: Kemeng Shi <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent f439111 commit edb46dd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/quota/dquot.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,8 @@ static int dquot_quota_enable(struct super_block *sb, unsigned int flags)
25942594
goto out_err;
25952595
}
25962596
if (sb_has_quota_limits_enabled(sb, type)) {
2597-
ret = -EBUSY;
2597+
/* compatible with XFS */
2598+
ret = -EEXIST;
25982599
goto out_err;
25992600
}
26002601
spin_lock(&dq_state_lock);
@@ -2608,9 +2609,6 @@ static int dquot_quota_enable(struct super_block *sb, unsigned int flags)
26082609
if (flags & qtype_enforce_flag(type))
26092610
dquot_disable(sb, type, DQUOT_LIMITS_ENABLED);
26102611
}
2611-
/* Error code translation for better compatibility with XFS */
2612-
if (ret == -EBUSY)
2613-
ret = -EEXIST;
26142612
return ret;
26152613
}
26162614

0 commit comments

Comments
 (0)