* [PATCH] ext4: silence complaint if CONFIG_QUOTA isn't set
@ 2023-04-30 16:54 Jens Axboe
2023-04-30 18:01 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2023-04-30 16:54 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: linux-ext4, LKML
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 <axboe@kernel.dk>
---
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_info *sbi)
rcu_read_unlock();
}
+static void ext4_free_quotas(struct super_block *sb,
+ struct ext4_sb_info *sbi)
+{
+#ifdef CONFIG_QUOTA
+ unsigned int i;
+
+ for (i = 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 = EXT4_SB(sb);
struct ext4_super_block *es = sbi->s_es;
int aborted = 0;
- int i, err;
+ int err;
/*
* 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 = 0; i < EXT4_MAXQUOTAS; i++)
- kfree(get_qf_name(sb, sbi, i));
-#endif
+ ext4_free_quotas(sb, sbi);
/* 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, struct super_block *sb)
ext4_fsblk_t logical_sb_block;
struct inode *root;
int ret = -ENOMEM;
- unsigned int i;
int needs_recovery;
int err = 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
-#ifdef CONFIG_QUOTA
- for (i = 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);
--
2.39.2
--
Jens Axboe
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: silence complaint if CONFIG_QUOTA isn't set
2023-04-30 16:54 [PATCH] ext4: silence complaint if CONFIG_QUOTA isn't set Jens Axboe
@ 2023-04-30 18:01 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2023-04-30 18:01 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-ext4, LKML
On Sun, Apr 30, 2023 at 10:54:38AM -0600, Jens Axboe wrote:
> Compiling the kernel ext4 spews a warning that 'i' is unused in two
> spots:
Thanks, we have a fix for this queued up for Linus already. It should
be pushed out shortly...
Cheers,
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-30 18:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-30 16:54 [PATCH] ext4: silence complaint if CONFIG_QUOTA isn't set Jens Axboe
2023-04-30 18:01 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).