From patchwork Mon Jul 15 13:05:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13733533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84011C3DA4B for ; Mon, 15 Jul 2024 13:08:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3FB246B00A9; Mon, 15 Jul 2024 09:07:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2DE696B00AC; Mon, 15 Jul 2024 09:07:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC45D6B00A9; Mon, 15 Jul 2024 09:07:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B89576B00A4 for ; Mon, 15 Jul 2024 09:07:57 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4D13C1A0F0D for ; Mon, 15 Jul 2024 13:07:57 +0000 (UTC) X-FDA: 82342014594.20.FA507B3 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf18.hostedemail.com (Postfix) with ESMTP id 0A5121C0025 for ; Mon, 15 Jul 2024 13:07:53 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721048838; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZGufKUrngVpIKdfPetZhExONsQPyAFgA7GZ77YjGsU4=; b=Jnb6mzOUKfjXWjfeQTdFrtvmzcZUcjPSNBOdU4EMh9pGYnJx7lgahB0eOrA1Xgh9rrigIS GeL09dHi63xrk4DrVhIdXqaTCewWLPAo3qKNXSlD67i5YNPIftsO3JHqsPoZaaRZMi7Jrz BUiCf8Wc9EXW9V/U0Whe6ApD1bJmKmE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721048838; a=rsa-sha256; cv=none; b=UzodkK7woLrE4NyYp9c+YBzSpp5QCaeP72BJYO3Dm9WST4e/m0DiIu7E/WZRtPQgGwJc13 6I1R1v7VfnxLA3HubSJlH4CmWVWh1uVJZ/d/9CS+olFse7lgtfSxqPTmDnJhqyWAj8+7vI sqeZWXz9BvzimIjT3Sjc/TcKxThwP9s= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4WN2YN1Y1Nz4f3mJJ for ; Mon, 15 Jul 2024 21:07:36 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 552FB1A0572 for ; Mon, 15 Jul 2024 21:07:49 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgBHKzkhH5VmjCPSAA--.61776S6; Mon, 15 Jul 2024 21:07:49 +0800 (CST) From: Kemeng Shi 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 Message-Id: <20240715130534.2112678-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240715130534.2112678-1-shikemeng@huaweicloud.com> References: <20240715130534.2112678-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgBHKzkhH5VmjCPSAA--.61776S6 X-Coremail-Antispam: 1UD129KBjvdXoWruF1UGFW7CF4DGw4kWry8Zrb_yoWDAwb_Ca 1I93ykZF48ur4SkanrJF4UA3WYgan5Aw1DXFs2yF98Gr1UJrW5JrWqqrykArs5ZanIkFZ8 C3ykAw10kF4rWjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfxYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r126s 0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2 WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkE bVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07UZTmfUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Queue-Id: 0A5121C0025 X-Stat-Signature: 5wxe5wymbt4its674th6z3316wj7cfyr X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1721048873-61029 X-HE-Meta: U2FsdGVkX1/rs3dXomaTVIk7UMUBuj7c6r9CAE+x11/mWnV1qfolxNaCkzgvsm9lMHloFTsl8kOV1gZMKwip6iFxOOOz6iRKvZKtLqUTNdFHzMh99H1ElF+XhGCo8FJQm1REU8ylRdYL5omBtNtLfPcJHDxIhGnUkh7YILPJRdj9Q6TDwJ7223iiXEpQ1BKGlZpBjb0YSAK6j1pJsiED7jiRP7+wBN618f7W+bm9OtHQSrFn9QttYiFdXeM0m2x1VWxSR7sxeygO9TkAQlGlJjqoKBQ1/jlv3aTTE8AQTzvdWUkFscWfn5uiT8tNeBIXk7TkjwPFGmde97q6TFSAKvoyj8smPPkDVsckfHEcUYHit5o4EzPyZY+chorRP2dMU/1g3BYPO0bzTdqbhgnt09xpTzBCAy8X3sYI5l/8S7W95rM7F/bAyicOiN7sP+xRgdSi2wK4Tz0gYlRedoAVRqhKxM7gsaOlwAvcCsr9vQKWGwu8Mpf/6R0uQI0R8bh4ewsvjX2Z528fH/uO13Shj4nLQhDTPAT+UeHb1KS5b6IQC56udP453koH6d9FwMzfFb0fJ6wtZi8XVOo2SjEnWAGwoE22RCXcUkpWvJwu3t3gYQyMHFpLfmHMtYtgkhbbAeMV0kH8cQOUg2C9IivMJb90UUIfDgduoW47ZGKuDPInw8XmZ678BlYNEtWeOZWrUzj94B94tYF++r6iNkSfnFX+AqLbwgna2ruv/U7tUOY1+cLuZWGb+LlYVdLtoQMRmfimS98atWanL2YqbBxH6rvloXrSZf/pMfZVp0Lki+m+0ozey5eD5tPYsX9z2NI0CnE/L+JAwm+9RJ1MxrAqrr7lHRyCYg5yzbQJs14956WZvj64FEUCNBBmA5NdmUUOjBTUvN936mdNeMDv0oC26qLMMdP4J4uw2Wvpgbd5eg57H+0Yms2ptT2c77lSwXEXoDrjTvrq5qwcGJsn+ki ZdL2ehG2 4md0/EEeThpq58OkdJ+GlTSYHADV+b2yHZB7aqESAXl+5F7Irny1Ivc3UJwgJ5cnuiJMBLlgfTK1neKeiWljoOGcjvf4V6Tid3r/Ka0JAtl6TvQEPXHQsBIiBS4fwPgZ/F1TZ0KHjTME20IjNLP5BjXiVux37D65CywKR08QoYI9KfR6IuazvxzvF4xDUHjHN6zFlqEc6wmyBB18Sj2E6OtoYaw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 --- 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; }