From patchwork Mon Jul 15 13:05:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13733536 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CBB018C16D for ; Mon, 15 Jul 2024 13:07:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721048873; cv=none; b=MzXOQgID61H5u3fIz6AcddaCUkfZBk95OxwPbjrZS2EfjzWIOZHva+N0em4BIaVdJo6hMypQm6GloraWnzCE5BYM5DACMrktP5J3oVzaRHKvvCNCUhwKI1G/+mg4IQ0GgyZCnr4WFAh6JFaHGOhTsb9MySnsuFVwdHGtXdRqNps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721048873; c=relaxed/simple; bh=scmUIrpt556yK+4eOEfui3X5RWBuHqjT5k4U/JnHPdw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GNf4Yn1ESTfdnMblhBiT95hI24fKbppq4TuqgDKHPLVt/qvZGGIFCfqqlCxc+WQJWM+EtnikfJe9yxHtB/Zxp2ryhYXGbYiNl/Aci8Y/1HqEbsu9DWl2CpO3Ig5vJ8AnjbqwI84QORalfXvW0i5SktgCvVJvPk+uy0ziGe21Hgw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4WN2YL75m9z4f3n6L for ; Mon, 15 Jul 2024 21:07:34 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 209691A01B9 for ; Mon, 15 Jul 2024 21:07:48 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgBHKzkhH5VmjCPSAA--.61776S3; Mon, 15 Jul 2024 21:07:47 +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 1/4] quota: avoid missing put_quota_format when DQUOT_SUSPENDED is passed Date: Mon, 15 Jul 2024 21:05:31 +0800 Message-Id: <20240715130534.2112678-2-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> Precedence: bulk X-Mailing-List: ocfs2-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: gCh0CgBHKzkhH5VmjCPSAA--.61776S3 X-Coremail-Antispam: 1UD129KBjvdXoW7XF45GFyDAryfWFW3XF1rXrb_yoWDWrg_K3 4Ik3y8ZFWxXF9ag3WqgrWfWrZ09ayrGws3WF4jyrnrJryDGr45ZF4vqF9xAa4kZ3y7t398 Zas2yry7KFWrWjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbTxYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r18M2 8IrcIa0xkI8VCY1x0267AKxVWUCVW8JwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F 4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0 oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7V C0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j 6r4UM4x0Y48IcxkI7VAKI48JMxkF7I0En4kS14v26r1q6r43MxAIw28IcxkI7VAKI48JMx C20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAF wI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20x vE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v2 0xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxV W8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU1_cTDUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ Avoid missing put_quota_format when DQUOT_SUSPENDED is passed to dquot_load_quota_sb. Signed-off-by: Kemeng Shi Reviewed-by: Joseph Qi --- fs/quota/dquot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 627eb2f72ef3..23fcf9e9d6c5 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2408,7 +2408,7 @@ static int vfs_setup_quota_inode(struct inode *inode, int type) int dquot_load_quota_sb(struct super_block *sb, int type, int format_id, unsigned int flags) { - struct quota_format_type *fmt = find_quota_format(format_id); + struct quota_format_type *fmt; struct quota_info *dqopt = sb_dqopt(sb); int error; @@ -2418,6 +2418,7 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id, if (WARN_ON_ONCE(flags & DQUOT_SUSPENDED)) return -EINVAL; + fmt = find_quota_format(format_id); if (!fmt) return -ESRCH; if (!sb->dq_op || !sb->s_qcop || From patchwork Mon Jul 15 13:05:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13733538 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CB5718C165 for ; Mon, 15 Jul 2024 13:07:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721048874; cv=none; b=UEAK1U2lb7zgss1l1LwGSWdqOAUi6TRjuEUO/5j+QqlUprZplOIFKYSWG37mZqM/S+6Cvj8Q1pnlZpK532dmPglY/cCwSypW4sQ/zM0SUoI7GMw4tzJue84GEECC5MqUn9Xyn0vgRhwnX+c3Aa0r449XQBtJgWJ9S+Ex2dIbFZk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721048874; c=relaxed/simple; bh=ePXF9ZLNfnoImIzw7g5TwMAtkddwvRI5bYuHlN/kTVM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dLf1Hggb4SiERTdp+4x9EiWqZEbf9qaMhM6inadGJtzJ2RLRzS76v7jKyfhj1ZpkfnN0BoZbwOE2OPSKNezrH4ta+Ij/moo7KDzepsZ53X2G/pVjUGKZaz4ldyiTVMHTZRAPrjmBLqr1C43/t/GoF400p8756t5kF7gE9gLp8uM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4WN2YM2nMCz4f3n6N for ; Mon, 15 Jul 2024 21:07:35 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 806D11A016E for ; Mon, 15 Jul 2024 21:07:48 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgBHKzkhH5VmjCPSAA--.61776S4; Mon, 15 Jul 2024 21:07:48 +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 2/4] quota: remove unneeded return value of register_quota_format Date: Mon, 15 Jul 2024 21:05:32 +0800 Message-Id: <20240715130534.2112678-3-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> Precedence: bulk X-Mailing-List: ocfs2-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: gCh0CgBHKzkhH5VmjCPSAA--.61776S4 X-Coremail-Antispam: 1UD129KBjvJXoWxXFy5WFyUJw13KF1fAr4fZrb_yoWrXF4xpw 1kCrs3tFyrtryDZ3yUXay5ury8W39rWF12vr48A3W2qrn09rW8Ar1UG34FvFy5Cry8Aw1Y qFn5C3W7Cw4jgrJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9Kb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUXw A2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMc Ij6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_ Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_Jw0_GFyl42xK82IYc2Ij64vIr4 1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK 67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI 8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAv wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14 v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU2WrWUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ The register_quota_format always returns 0, simply remove unneeded return value. Signed-off-by: Kemeng Shi Reviewed-by: Joseph Qi --- fs/ocfs2/super.c | 6 ++---- fs/quota/dquot.c | 3 +-- fs/quota/quota_v1.c | 3 ++- fs/quota/quota_v2.c | 9 +++------ include/linux/quota.h | 2 +- mm/shmem.c | 7 +------ 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index afee70125ae3..73caa8914ebe 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1571,15 +1571,13 @@ static int __init ocfs2_init(void) ocfs2_set_locking_protocol(); - status = register_quota_format(&ocfs2_quota_format); - if (status < 0) - goto out3; + register_quota_format(&ocfs2_quota_format); + status = register_filesystem(&ocfs2_fs_type); if (!status) return 0; unregister_quota_format(&ocfs2_quota_format); -out3: debugfs_remove(ocfs2_debugfs_root); ocfs2_free_mem_caches(); out2: diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 23fcf9e9d6c5..a08a71890cd8 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -163,13 +163,12 @@ static struct quota_module_name module_names[] = INIT_QUOTA_MODULE_NAMES; /* SLAB cache for dquot structures */ static struct kmem_cache *dquot_cachep; -int register_quota_format(struct quota_format_type *fmt) +void register_quota_format(struct quota_format_type *fmt) { spin_lock(&dq_list_lock); fmt->qf_next = quota_formats; quota_formats = fmt; spin_unlock(&dq_list_lock); - return 0; } EXPORT_SYMBOL(register_quota_format); diff --git a/fs/quota/quota_v1.c b/fs/quota/quota_v1.c index 3f3e8acc05db..6f7f0b4afba9 100644 --- a/fs/quota/quota_v1.c +++ b/fs/quota/quota_v1.c @@ -235,7 +235,8 @@ static struct quota_format_type v1_quota_format = { static int __init init_v1_quota_format(void) { - return register_quota_format(&v1_quota_format); + register_quota_format(&v1_quota_format); + return 0; } static void __exit exit_v1_quota_format(void) diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index c48c233f3bef..1fda93dcbc1b 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -440,12 +440,9 @@ static struct quota_format_type v2r1_quota_format = { static int __init init_v2_quota_format(void) { - int ret; - - ret = register_quota_format(&v2r0_quota_format); - if (ret) - return ret; - return register_quota_format(&v2r1_quota_format); + register_quota_format(&v2r0_quota_format); + register_quota_format(&v2r1_quota_format); + return 0; } static void __exit exit_v2_quota_format(void) diff --git a/include/linux/quota.h b/include/linux/quota.h index 07071e64abf3..89a0d83ddad0 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -526,7 +526,7 @@ struct quota_info { const struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ }; -int register_quota_format(struct quota_format_type *fmt); +void register_quota_format(struct quota_format_type *fmt); void unregister_quota_format(struct quota_format_type *fmt); struct quota_module_name { diff --git a/mm/shmem.c b/mm/shmem.c index a8b181a63402..d27104e1af9b 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -4660,11 +4660,7 @@ void __init shmem_init(void) shmem_init_inodecache(); #ifdef CONFIG_TMPFS_QUOTA - error = register_quota_format(&shmem_quota_format); - if (error < 0) { - pr_err("Could not register quota format\n"); - goto out3; - } + register_quota_format(&shmem_quota_format); #endif error = register_filesystem(&shmem_fs_type); @@ -4693,7 +4689,6 @@ void __init shmem_init(void) out2: #ifdef CONFIG_TMPFS_QUOTA unregister_quota_format(&shmem_quota_format); -out3: #endif shmem_destroy_inodecache(); shm_mnt = ERR_PTR(error); From patchwork Mon Jul 15 13:05:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13733535 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5BD518C320 for ; Mon, 15 Jul 2024 13:07:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721048873; cv=none; b=gb2Pb9G0Xj/P9/Hfk8t59NKqtyUv9AdBLRINdD1AT1+Ep2OZzSpPdT1GSSeyDE4kQwrbgQ3dgQyvhTeV9CKNjsvT59or8DBBFcX3NDGylVrCYMAOkOHQax5nsBfyIk7lX9duC7BF72cVjJ4LOanqVLj1+pGNXcnwATbPyEWnY0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721048873; c=relaxed/simple; bh=xHT4+bFd6sXV4vlzD8qkhOgc25DmDNqPRZ6ChEspulo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BGFUI3iXM+YBZXEe5Bg3z7YGASj++d0T+Hr4qam4eLNq7n1Z1LrvdV/wVhyR8tpL1Ey4sez1Ovz31AgP3OySPgetassbU95i90e752CqN+NgbOo2+7nvA87nuHKrY7pmT0hWpO4RGMcvUDWWphyBkcC6AG3NQ8hZIpDwFvyu2QA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4WN2YT0Pw8z4f3kkH for ; Mon, 15 Jul 2024 21:07:41 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id ED5481A0181 for ; Mon, 15 Jul 2024 21:07:48 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgBHKzkhH5VmjCPSAA--.61776S5; Mon, 15 Jul 2024 21:07:48 +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 3/4] quota: remove redundant return at end of void function Date: Mon, 15 Jul 2024 21:05:33 +0800 Message-Id: <20240715130534.2112678-4-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> Precedence: bulk X-Mailing-List: ocfs2-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: gCh0CgBHKzkhH5VmjCPSAA--.61776S5 X-Coremail-Antispam: 1UD129KBjvdXoWrury3ZryfXr4rur1fCF4xtFb_yoWDJFX_Cr yfu34Fyr4Ut3Z3tFWUtr4rJwnaqws8Cw1UXF47t3W3Gw1rtrW8Ar1qvwn3JryDJ347C3y3 CrW8CrsrGFWrKjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbTkYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r1rM2 8IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx 0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWU JVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrw CFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE 14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2 IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxK x2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI 0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07UACztUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ Function dquot_claim_space_nodirty nad dquot_reclaim_space_nodirty have no return value, just remove redundant return at end of the functions. Signed-off-by: Kemeng Shi --- fs/quota/dquot.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index a08a71890cd8..2ca1f16689de 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1830,7 +1830,6 @@ void dquot_claim_space_nodirty(struct inode *inode, qsize_t number) spin_unlock(&inode->i_lock); mark_all_dquot_dirty(dquots); srcu_read_unlock(&dquot_srcu, index); - return; } EXPORT_SYMBOL(dquot_claim_space_nodirty); @@ -1872,7 +1871,6 @@ void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number) spin_unlock(&inode->i_lock); mark_all_dquot_dirty(dquots); srcu_read_unlock(&dquot_srcu, index); - return; } EXPORT_SYMBOL(dquot_reclaim_space_nodirty); 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: 13733537 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5547818C331 for ; Mon, 15 Jul 2024 13:07:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721048873; cv=none; b=lRV26JvcNYbXkTuaV+O6RS6qrdPIbidtk7PZb/y5hV7L33NM5iUXmmpam+W0V5OsQRCOEYUcDXn2+HVBFSUZjlro4d/hK+4Z1/G5EFXpCMu/XamsSFFHLV5/wyRHBfL7dVIKng8fiz8Q5FbGOz1T/pvGVg9G/mn3x4xiXyErOcY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721048873; c=relaxed/simple; bh=O/EUR4LuyoK3NKi3Bs380ukJ5pwbD+rvk2y103dnjK0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YtBK/j+Squ4Ar0NitMqGo5O1iKDWeVzW9uIJrmkgKIGgmNvGuDdYg00ymix06AUw7wlt2CjhxOIZg5npy8EGw5tWAWIbFejBWvQ5qC5Kyqr8DyCyTdQjkDquPnGGHJ1P+BEH3GpuOl09pJBEI1D3thxfFKmGuny2ncMJeNRPC9w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4WN2YN1wqWz4f3mJK 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 62E031A016E 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> Precedence: bulk X-Mailing-List: ocfs2-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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/ 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; }