Re: [PATCH 08/10] minix: handle set_blocksize failures

Christian Brauner <[email protected]> Tue, 12 May 2026 14:13:49 +0200
Newsgroups dev.linux.lists.ntfs3,org.kernel.vger.linux-fsdevel
Message-ID <20260512-umgehen-hafer-6022c6046c60@brauner>
On Tue, May 12, 2026 at 08:08:30AM +0200, Christoph Hellwig wrote:
> On Mon, May 11, 2026 at 06:08:18PM +0200, Jan Kara wrote:
> > On Mon 11-05-26 09:16:53, Christoph Hellwig wrote:
> > > minix uses buffer_heads, which don't handle block size > PAGE_SIZE well.
> > > Without this, mounting we will hit the
> > > 
> > >         BUG_ON(offset >= folio_size(folio));
> > > 
> > > in folio_set_bh on the first __bread_gfp call.
> > > 
> > > Signed-off-by: Christoph Hellwig <[email protected]>
> > > ---
> > >  fs/minix/inode.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/fs/minix/inode.c b/fs/minix/inode.c
> > > index 9c6bac248907..03a69b13950d 100644
> > > --- a/fs/minix/inode.c
> > > +++ b/fs/minix/inode.c
> > > @@ -292,7 +292,8 @@ static int minix_fill_super(struct super_block *s, struct fs_context *fc)
> > >  		sbi->s_namelen = 60;
> > >  		sbi->s_version = MINIX_V3;
> > >  		sbi->s_mount_state = MINIX_VALID_FS;
> > > -		sb_set_blocksize(s, m3s->s_blocksize);
> > > +		if (!sb_set_blocksize(s, m3s->s_blocksize))
> > > +			goto out;
> > 
> > This should go to out_release AFAICT. Otherwise we leak the bh.
> 
> Yes.  Christian, do you want a resend or incremental patch?

Incremental patch. When we reasonably can fold something clean we should
do it instead of refiring a bunch of mails.