From nobody Thu Feb 12 01:45:53 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF9F3C77B73 for ; Sun, 30 Apr 2023 16:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230399AbjD3Qyo (ORCPT ); Sun, 30 Apr 2023 12:54:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjD3Qym (ORCPT ); Sun, 30 Apr 2023 12:54:42 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6620171D for ; Sun, 30 Apr 2023 09:54:40 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1aad6f208e8so1861305ad.1 for ; Sun, 30 Apr 2023 09:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1682873680; x=1685465680; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=GNG8RUsR9FUAqdTwLBaZpI6pJsBbKdyT1Msigj0pj48=; b=aZzu9BHxz1JrW/wmyl5h1y7qfhzXiZzls/8ZLLTnRy2Bcc9GY7pB8JERJcXpvDvzIm DmyP/ApSYwYBMRNlSoDqaf2meQi+mhuDSJyzqJ1HZAIbMJdQrbuJug7xJ48V8PRVLTux lkEOFl4vqL9ltrwSKr5tfnhOQTLx5I8fQJwoxo1TowkXREvcEhpO0kAB8LecFKqsqy3l l1r6+A/oVgkKm0prxdAAmN8OTMhk1lCiJmuPm074K5sCeXcByqx56ISI6kTRlbm9tdo/ GJSkhBkUU2jYyKiXA4j3revMfKYKDFI/m157NGEi042fWQOPBUGR/3ZxVBz/fi+74RHU tn1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682873680; x=1685465680; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=GNG8RUsR9FUAqdTwLBaZpI6pJsBbKdyT1Msigj0pj48=; b=d1+P/ZuW2ANrLUAFL2gSRAOJKQd6Bx6KUFjfPYJjIhhs/g9ByzcbTvifgn9UVsPPlV ff3cjg242XkgLcLnL7nrZras1xRyYM5ZPnpvN7KHOML6Q76RW4ITb7gQ9q56QcinLtZU T3IwBnweHFHugTvUsFC25FKGbz52MlNXpPmMCwg0gfLA/Lol5oSkJUYnyVH1KgxJPncx sLNgW1fxdI+7AwuHvSRK2WD6b+5K8oI3gGwhDdI2OX7rk8PHKfqEKi/W5nyBs/j92LeE M7gkG+BWLBN0qP+Ih9ORakcvwsCVdthgyTp8AvFZtExARHZI5jXggVEjkdgU2Xzdp26c 23+A== X-Gm-Message-State: AC+VfDwtkpLTQU/d418kueWMF/zIYrHbK8aRom1r9A5+vCDOWYtbKbo0 JaP0NmdxR4s+J0gK0qaZik5F0G5sWzcB5wPisFw= X-Google-Smtp-Source: ACHHUZ4nZSYEgXjT0MGD1P7m/BExrB7PV9aa0CpbB1RuqZ+/EsvVQs2Pv48ukoN985SXcfoWWygwtQ== X-Received: by 2002:a17:902:ea10:b0:1a9:1b4:9fdd with SMTP id s16-20020a170902ea1000b001a901b49fddmr10815448plg.2.1682873679998; Sun, 30 Apr 2023 09:54:39 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id jw11-20020a170903278b00b0019a593e45f1sm16472780plb.261.2023.04.30.09.54.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Apr 2023 09:54:39 -0700 (PDT) Message-ID: <123c391a-2569-6afd-2461-4e5b2ca298f3@kernel.dk> Date: Sun, 30 Apr 2023 10:54:38 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: Theodore Ts'o Cc: "linux-ext4@vger.kernel.org" , LKML From: Jens Axboe Subject: [PATCH] ext4: silence complaint if CONFIG_QUOTA isn't set Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Compiling the kernel ext4 spews a warning that 'i' is unused in two spots: axboe@m1max ~/gi/linux-block (master)> make fs/ext4/super.o = 0.027s CALL scripts/checksyscalls.sh CC fs/ext4/super.o fs/ext4/super.c: In function ?ext4_put_super?: fs/ext4/super.c:1262:13: warning: unused variable ?i? [-Wunused-variable] 1262 | int i, err; | ^ fs/ext4/super.c: In function ?__ext4_fill_super?: fs/ext4/super.c:5200:22: warning: unused variable ?i? [-Wunused-variable] 5200 | unsigned int i; | ^ Put the quota freeing code into a helper so we can stub it out for !CONFIG_QUOTA. Signed-off-by: Jens Axboe --- This appears new, but I didn't check what commit potentially broke this... fs/ext4/super.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index d03bf0ecf505..5d85d7377d84 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1254,12 +1254,23 @@ static void ext4_flex_groups_free(struct ext4_sb_in= fo *sbi) rcu_read_unlock(); } =20 +static void ext4_free_quotas(struct super_block *sb, + struct ext4_sb_info *sbi) +{ +#ifdef CONFIG_QUOTA + unsigned int i; + + for (i =3D 0; i < EXT4_MAXQUOTAS; i++) + kfree(get_qf_name(sb, sbi, i)); +#endif +} + static void ext4_put_super(struct super_block *sb) { struct ext4_sb_info *sbi =3D EXT4_SB(sb); struct ext4_super_block *es =3D sbi->s_es; int aborted =3D 0; - int i, err; + int err; =20 /* * Unregister sysfs before destroying jbd2 journal. @@ -1310,10 +1321,7 @@ static void ext4_put_super(struct super_block *sb) ext4_group_desc_free(sbi); ext4_flex_groups_free(sbi); ext4_percpu_param_destroy(sbi); -#ifdef CONFIG_QUOTA - for (i =3D 0; i < EXT4_MAXQUOTAS; i++) - kfree(get_qf_name(sb, sbi, i)); -#endif + ext4_free_quotas(sb, sbi); =20 /* Debugging code just in case the in-memory inode orphan list * isn't empty. The on-disk one can be non-empty if we've @@ -5197,7 +5205,6 @@ static int __ext4_fill_super(struct fs_context *fc, s= truct super_block *sb) ext4_fsblk_t logical_sb_block; struct inode *root; int ret =3D -ENOMEM; - unsigned int i; int needs_recovery; int err =3D 0; ext4_group_t first_not_zeroed; @@ -5627,10 +5634,7 @@ static int __ext4_fill_super(struct fs_context *fc, = struct super_block *sb) utf8_unload(sb->s_encoding); #endif =20 -#ifdef CONFIG_QUOTA - for (i =3D 0; i < EXT4_MAXQUOTAS; i++) - kfree(get_qf_name(sb, sbi, i)); -#endif + ext4_free_quotas(sb, sbi); fscrypt_free_dummy_policy(&sbi->s_dummy_enc_policy); /* ext4_blkdev_remove() calls kill_bdev(), release bh before it. */ brelse(sbi->s_sbh); --=20 2.39.2 --=20 Jens Axboe