[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3em3tz563leuu7tvmpraidujtizfcc3567hpadfnd25ngcvh6m@desdok2weaf7>
Date: Mon, 24 Nov 2025 18:34:33 +0100
From: Jan Kara <jack@...e.cz>
To: Jori Koolstra <jkoolstra@...all.nl>
Cc: Christian Brauner <brauner@...nel.org>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>, Jan Kara <jack@...e.cz>, Taotao Chen <chentaotao@...iglobal.com>,
Shuah Khan <skhan@...uxfoundation.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] minix: calculate s_firstdatazone to support more
inodes
On Mon 17-11-25 23:05:22, Jori Koolstra wrote:
> We can potentially ignore the on-disk s_firstdatazone and calculate the
> value on the fly instead. Since this field is only a u16, this allows
> more inodes to be handled. The mfs implementation in the minix OS does
> roughly the same. Currently there is no support for s_firstdatazone=0 in
> utils-linux.
>
> Signed-off-by: Jori Koolstra <jkoolstra@...all.nl>
This changelog misses explanation why handling s_firstdatazone == 0 is a
good idea in the first place. Is it somehow situation present in real
filesystems? If not then then why bother? More flexibility in accepting
garbage always means more trouble down the road :), we've learned this
lesson several times.
Honza
> ---
> fs/minix/inode.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/fs/minix/inode.c b/fs/minix/inode.c
> index 8eb26ff91adf..d4a43bc86890 100644
> --- a/fs/minix/inode.c
> +++ b/fs/minix/inode.c
> @@ -272,6 +272,15 @@ static int minix_fill_super(struct super_block *s, struct fs_context *fc)
> } else
> goto out_no_fs;
>
> + /* We can potentially ignore the on-disk s_firstdatazone and instead
> + * calculate the value on the fly. Since this field is only a u16,
> + * this allows more inodes to be handled.
> + */
> + if (sbi->s_firstdatazone == 0) {
> + sbi->s_firstdatazone = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
> + minix_blocks_needed(sbi->s_ninodes, s->s_blocksize);
> + }
> +
> if (!minix_check_superblock(s))
> goto out_illegal_sb;
>
> --
> 2.51.2
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists