* Recent changes mean sb_min_blocksize() can now fail
@ 2025-04-08 5:33 Phillip Lougher
2025-04-08 10:39 ` Jan Kara
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Phillip Lougher @ 2025-04-08 5:33 UTC (permalink / raw)
To: Jan Kara, Andreas Gruenbacher, Namjae Jeon, Sungjong Seo,
OGAWA Hirofumi, Carlos Maiolino, Darrick J. Wong
Cc: linux-fsdevel, linux-kernel, Luis Chamberlain
Hi,
A recent (post 6.14) change to the kernel means sb_min_blocksize() can now fail,
and any filesystem which doesn't check the result may behave unexpectedly as a
result. This change has recently affected Squashfs, and checking the kernel code,
a number of other filesystems including isofs, gfs2, exfat, fat and xfs do not
check the result. This is a courtesy email to warn others of this change.
The following emails give the relevant details.
https://lore.kernel.org/all/2a13ea1c-08df-4807-83d4-241831b7a2ec@squashfs.org.uk/
https://lore.kernel.org/all/129d4f39-6922-44e9-8b1c-6455ee564dda@squashfs.org.uk/
Regards
Phillip
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Recent changes mean sb_min_blocksize() can now fail
2025-04-08 5:33 Recent changes mean sb_min_blocksize() can now fail Phillip Lougher
@ 2025-04-08 10:39 ` Jan Kara
2025-04-08 10:51 ` Jan Kara
2025-04-08 13:11 ` Sungjong Seo
2025-04-08 11:27 ` OGAWA Hirofumi
` (2 subsequent siblings)
3 siblings, 2 replies; 8+ messages in thread
From: Jan Kara @ 2025-04-08 10:39 UTC (permalink / raw)
To: Phillip Lougher
Cc: Jan Kara, Andreas Gruenbacher, Namjae Jeon, Sungjong Seo,
OGAWA Hirofumi, Carlos Maiolino, Darrick J. Wong, linux-fsdevel,
linux-kernel, Luis Chamberlain
Hi!
On Tue 08-04-25 06:33:53, Phillip Lougher wrote:
> A recent (post 6.14) change to the kernel means sb_min_blocksize() can now fail,
> and any filesystem which doesn't check the result may behave unexpectedly as a
> result. This change has recently affected Squashfs, and checking the kernel code,
> a number of other filesystems including isofs, gfs2, exfat, fat and xfs do not
> check the result. This is a courtesy email to warn others of this change.
>
> The following emails give the relevant details.
>
> https://lore.kernel.org/all/2a13ea1c-08df-4807-83d4-241831b7a2ec@squashfs.org.uk/
> https://lore.kernel.org/all/129d4f39-6922-44e9-8b1c-6455ee564dda@squashfs.org.uk/
Indeed. Thanks for the heads up!
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Recent changes mean sb_min_blocksize() can now fail
2025-04-08 10:39 ` Jan Kara
@ 2025-04-08 10:51 ` Jan Kara
2025-04-08 17:13 ` Luis Chamberlain
2025-04-08 13:11 ` Sungjong Seo
1 sibling, 1 reply; 8+ messages in thread
From: Jan Kara @ 2025-04-08 10:51 UTC (permalink / raw)
To: Phillip Lougher
Cc: Jan Kara, Andreas Gruenbacher, Namjae Jeon, Sungjong Seo,
OGAWA Hirofumi, Carlos Maiolino, Darrick J. Wong, linux-fsdevel,
linux-kernel, Luis Chamberlain
On Tue 08-04-25 12:39:52, Jan Kara wrote:
> Hi!
>
> On Tue 08-04-25 06:33:53, Phillip Lougher wrote:
> > A recent (post 6.14) change to the kernel means sb_min_blocksize() can now fail,
> > and any filesystem which doesn't check the result may behave unexpectedly as a
> > result. This change has recently affected Squashfs, and checking the kernel code,
> > a number of other filesystems including isofs, gfs2, exfat, fat and xfs do not
> > check the result. This is a courtesy email to warn others of this change.
> >
> > The following emails give the relevant details.
> >
> > https://lore.kernel.org/all/2a13ea1c-08df-4807-83d4-241831b7a2ec@squashfs.org.uk/
> > https://lore.kernel.org/all/129d4f39-6922-44e9-8b1c-6455ee564dda@squashfs.org.uk/
>
> Indeed. Thanks for the heads up!
But isofs is actually fine since setting bdev block size needs exclusive open
(i.e., has to happen before filesystem mount begins and claims bdev) and
isofs does:
if (bdev_logical_block_size(s->s_bdev) > 2048)
bail
in its isofs_fill_super().
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Recent changes mean sb_min_blocksize() can now fail
2025-04-08 5:33 Recent changes mean sb_min_blocksize() can now fail Phillip Lougher
2025-04-08 10:39 ` Jan Kara
@ 2025-04-08 11:27 ` OGAWA Hirofumi
2025-04-08 14:31 ` Darrick J. Wong
2025-04-08 17:36 ` Kent Overstreet
3 siblings, 0 replies; 8+ messages in thread
From: OGAWA Hirofumi @ 2025-04-08 11:27 UTC (permalink / raw)
To: Phillip Lougher
Cc: Jan Kara, Andreas Gruenbacher, Namjae Jeon, Sungjong Seo,
Carlos Maiolino, Darrick J. Wong, linux-fsdevel, linux-kernel,
Luis Chamberlain
Phillip Lougher <phillip@squashfs.org.uk> writes:
> A recent (post 6.14) change to the kernel means sb_min_blocksize() can now fail,
> and any filesystem which doesn't check the result may behave unexpectedly as a
> result. This change has recently affected Squashfs, and checking the kernel code,
> a number of other filesystems including isofs, gfs2, exfat, fat and xfs do not
> check the result. This is a courtesy email to warn others of this change.
>
> The following emails give the relevant details.
>
> https://lore.kernel.org/all/2a13ea1c-08df-4807-83d4-241831b7a2ec@squashfs.org.uk/
> https://lore.kernel.org/all/129d4f39-6922-44e9-8b1c-6455ee564dda@squashfs.org.uk/
Thanks. FATfs should have no issue.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Recent changes mean sb_min_blocksize() can now fail
2025-04-08 10:39 ` Jan Kara
2025-04-08 10:51 ` Jan Kara
@ 2025-04-08 13:11 ` Sungjong Seo
1 sibling, 0 replies; 8+ messages in thread
From: Sungjong Seo @ 2025-04-08 13:11 UTC (permalink / raw)
To: 'Jan Kara', 'Phillip Lougher'
Cc: 'Andreas Gruenbacher', 'Namjae Jeon',
'OGAWA Hirofumi', 'Carlos Maiolino',
'Darrick J. Wong', linux-fsdevel, linux-kernel,
'Luis Chamberlain', sjdev.seo, sj1557.seo, cpgs
Hi, All
> Hi!
>
> On Tue 08-04-25 06:33:53, Phillip Lougher wrote:
> > A recent (post 6.14) change to the kernel means sb_min_blocksize() can
> now fail,
> > and any filesystem which doesn't check the result may behave
> unexpectedly as a
> > result. This change has recently affected Squashfs, and checking the
> kernel code,
> > a number of other filesystems including isofs, gfs2, exfat, fat and xfs
> do not
> > check the result. This is a courtesy email to warn others of this
> change.
> >
> > The following emails give the relevant details.
> >
> > https://lore.kernel.org/all/2a13ea1c-08df-4807-83d4-
> 241831b7a2ec@squashfs.org.uk/
> > https://lore.kernel.org/all/129d4f39-6922-44e9-8b1c-
> 6455ee564dda@squashfs.org.uk/
>
> Indeed. Thanks for the heads up!
>
> Honza
> --
> Jan Kara <jack@suse.com>
> SUSE Labs, CR
exfat-fs calls it to set it to the minimum value of 512, but it's not
particularly problematic if it fails.
Thank you
B.R.
Sungjong Seo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Recent changes mean sb_min_blocksize() can now fail
2025-04-08 5:33 Recent changes mean sb_min_blocksize() can now fail Phillip Lougher
2025-04-08 10:39 ` Jan Kara
2025-04-08 11:27 ` OGAWA Hirofumi
@ 2025-04-08 14:31 ` Darrick J. Wong
2025-04-08 17:36 ` Kent Overstreet
3 siblings, 0 replies; 8+ messages in thread
From: Darrick J. Wong @ 2025-04-08 14:31 UTC (permalink / raw)
To: Phillip Lougher
Cc: Jan Kara, Andreas Gruenbacher, Namjae Jeon, Sungjong Seo,
OGAWA Hirofumi, Carlos Maiolino, linux-fsdevel, linux-kernel,
Luis Chamberlain
On Tue, Apr 08, 2025 at 06:33:53AM +0100, Phillip Lougher wrote:
> Hi,
>
> A recent (post 6.14) change to the kernel means sb_min_blocksize() can now fail,
> and any filesystem which doesn't check the result may behave unexpectedly as a
> result. This change has recently affected Squashfs, and checking the kernel code,
> a number of other filesystems including isofs, gfs2, exfat, fat and xfs do not
> check the result. This is a courtesy email to warn others of this change.
Thanks for the heads up. xfs always passes in BBSIZE (aka 512) and
doesn't use the bdev pagecache so I think it's unaffected by failures.
--D
> The following emails give the relevant details.
>
> https://lore.kernel.org/all/2a13ea1c-08df-4807-83d4-241831b7a2ec@squashfs.org.uk/
> https://lore.kernel.org/all/129d4f39-6922-44e9-8b1c-6455ee564dda@squashfs.org.uk/
>
> Regards
>
> Phillip
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Recent changes mean sb_min_blocksize() can now fail
2025-04-08 10:51 ` Jan Kara
@ 2025-04-08 17:13 ` Luis Chamberlain
0 siblings, 0 replies; 8+ messages in thread
From: Luis Chamberlain @ 2025-04-08 17:13 UTC (permalink / raw)
To: Jan Kara
Cc: Phillip Lougher, Andreas Gruenbacher, Namjae Jeon, Sungjong Seo,
OGAWA Hirofumi, Carlos Maiolino, Darrick J. Wong, linux-fsdevel,
linux-kernel
On Tue, Apr 08, 2025 at 12:51:37PM +0200, Jan Kara wrote:
> On Tue 08-04-25 12:39:52, Jan Kara wrote:
> > Hi!
> >
> > On Tue 08-04-25 06:33:53, Phillip Lougher wrote:
> > > A recent (post 6.14) change to the kernel means sb_min_blocksize() can now fail,
> > > and any filesystem which doesn't check the result may behave unexpectedly as a
> > > result. This change has recently affected Squashfs, and checking the kernel code,
> > > a number of other filesystems including isofs, gfs2, exfat, fat and xfs do not
> > > check the result. This is a courtesy email to warn others of this change.
> > >
> > > The following emails give the relevant details.
> > >
> > > https://lore.kernel.org/all/2a13ea1c-08df-4807-83d4-241831b7a2ec@squashfs.org.uk/
> > > https://lore.kernel.org/all/129d4f39-6922-44e9-8b1c-6455ee564dda@squashfs.org.uk/
> >
> > Indeed. Thanks for the heads up!
>
> But isofs is actually fine since setting bdev block size needs exclusive open
> (i.e., has to happen before filesystem mount begins and claims bdev) and
> isofs does:
>
> if (bdev_logical_block_size(s->s_bdev) > 2048)
> bail
>
> in its isofs_fill_super().
Regardless, we added commit a64e5a596067bddb ("bdev: add back PAGE_SIZE
block size validation for sb_set_blocksize()" to effectively revert back
to the original behaviour, and so only filesystems which have FS_LBS are
not blocked by PAGE_SIZE.
Let me know if you still are seeing issues even with this patch merged.
Luis
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Recent changes mean sb_min_blocksize() can now fail
2025-04-08 5:33 Recent changes mean sb_min_blocksize() can now fail Phillip Lougher
` (2 preceding siblings ...)
2025-04-08 14:31 ` Darrick J. Wong
@ 2025-04-08 17:36 ` Kent Overstreet
3 siblings, 0 replies; 8+ messages in thread
From: Kent Overstreet @ 2025-04-08 17:36 UTC (permalink / raw)
To: Phillip Lougher
Cc: Jan Kara, Andreas Gruenbacher, Namjae Jeon, Sungjong Seo,
OGAWA Hirofumi, Carlos Maiolino, Darrick J. Wong, linux-fsdevel,
linux-kernel, Luis Chamberlain
On Tue, Apr 08, 2025 at 06:33:53AM +0100, Phillip Lougher wrote:
> Hi,
>
> A recent (post 6.14) change to the kernel means sb_min_blocksize() can now fail,
> and any filesystem which doesn't check the result may behave unexpectedly as a
> result. This change has recently affected Squashfs, and checking the kernel code,
> a number of other filesystems including isofs, gfs2, exfat, fat and xfs do not
> check the result. This is a courtesy email to warn others of this change.
>
> The following emails give the relevant details.
>
> https://lore.kernel.org/all/2a13ea1c-08df-4807-83d4-241831b7a2ec@squashfs.org.uk/
> https://lore.kernel.org/all/129d4f39-6922-44e9-8b1c-6455ee564dda@squashfs.org.uk/
>
> Regards
>
> Phillip
this would be a good time to use __must_check
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-04-08 17:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 5:33 Recent changes mean sb_min_blocksize() can now fail Phillip Lougher
2025-04-08 10:39 ` Jan Kara
2025-04-08 10:51 ` Jan Kara
2025-04-08 17:13 ` Luis Chamberlain
2025-04-08 13:11 ` Sungjong Seo
2025-04-08 11:27 ` OGAWA Hirofumi
2025-04-08 14:31 ` Darrick J. Wong
2025-04-08 17:36 ` Kent Overstreet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox