linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kemeng Shi <shikemeng@huaweicloud.com>
To: jack@suse.com
Cc: mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
	hughd@google.com, akpm@linux-foundation.org,
	ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: [PATCH 4/4] quota: remove unnecessary error code translation in dquot_quota_enable
Date: Mon, 15 Jul 2024 21:05:34 +0800	[thread overview]
Message-ID: <20240715130534.2112678-5-shikemeng@huaweicloud.com> (raw)
In-Reply-To: <20240715130534.2112678-1-shikemeng@huaweicloud.com>

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

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
 fs/quota/dquot.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 2ca1f16689de..fdf19360ffc9 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2598,7 +2598,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);
@@ -2612,9 +2613,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;
 }
 
-- 
2.30.0



  parent reply	other threads:[~2024-07-15 13:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 13:05 [PATCH 0/4] Fix and cleanups to quota Kemeng Shi
2024-07-15 13:05 ` [PATCH 1/4] quota: avoid missing put_quota_format when DQUOT_SUSPENDED is passed Kemeng Shi
2024-07-16  1:10   ` Joseph Qi
2024-07-17 13:09     ` Jan Kara
2024-07-15 13:05 ` [PATCH 2/4] quota: remove unneeded return value of register_quota_format Kemeng Shi
2024-07-16  1:19   ` Joseph Qi
2024-07-15 13:05 ` [PATCH 3/4] quota: remove redundant return at end of void function Kemeng Shi
2024-07-15 13:05 ` Kemeng Shi [this message]
2024-07-17 13:12 ` [PATCH 0/4] Fix and cleanups to quota Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240715130534.2112678-5-shikemeng@huaweicloud.com \
    --to=shikemeng@huaweicloud.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=jack@suse.com \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox