From: Jan Kara <jack@suse.cz>
To: Zhang Yi <yi.zhang@huaweicloud.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu,
adilger.kernel@dilger.ca, jack@suse.cz, yi.zhang@huawei.com,
chengzhihao1@huawei.com, yukuai3@huawei.com
Subject: Re: [PATCH] ext4: add a hint for block bitmap corrupt state in mb_groups
Date: Fri, 19 Jan 2024 15:33:24 +0100 [thread overview]
Message-ID: <20240119143324.5cehalj5wgy7cozc@quack3> (raw)
In-Reply-To: <20240119061154.1525781-1-yi.zhang@huaweicloud.com>
On Fri 19-01-24 14:11:54, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@huawei.com>
>
> If one group is marked as block bitmap corrupted, its free blocks cannot
> be used and its free count is also deducted from the global
> sbi->s_freeclusters_counter. User might be confused about the absent
> free space because we can't query the information about corrupted block
> groups except unreliable error messages in syslog. So add a hint to show
> block bitmap corrupted groups in mb_groups.
>
> Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/mballoc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index d72b5e3c92ec..641c9be8e25e 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -3035,7 +3035,10 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v)
> for (i = 0; i <= 13; i++)
> seq_printf(seq, " %-5u", i <= blocksize_bits + 1 ?
> sg.info.bb_counters[i] : 0);
> - seq_puts(seq, " ]\n");
> + seq_puts(seq, " ]");
> + if (EXT4_MB_GRP_BBITMAP_CORRUPT(&sg.info))
> + seq_puts(seq, " Block bitmap corrupted!");
> + seq_puts(seq, "\n");
>
> return 0;
> }
> --
> 2.39.2
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-01-19 14:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-19 6:11 [PATCH] ext4: add a hint for block bitmap corrupt state in mb_groups Zhang Yi
2024-01-19 14:33 ` Jan Kara [this message]
2024-02-22 15:54 ` Theodore Ts'o
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=20240119143324.5cehalj5wgy7cozc@quack3 \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=chengzhihao1@huawei.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.com \
--cc=yi.zhang@huaweicloud.com \
--cc=yukuai3@huawei.com \
/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