[LTP] [linux-next:master] [block/bdev] 47dd675323: ltp.ioctl_loop06.fail
Luis Chamberlain
mcgrof@kernel.org
Wed Mar 12 06:00:43 CET 2025
On Tue, Mar 11, 2025 at 09:09:08PM +0800, Li Wang wrote:
> On Tue, Mar 11, 2025 at 11:33 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
>
> > On Tue, Mar 11, 2025 at 09:43:42AM +0800, Li Wang wrote:
> > > On Mon, Mar 10, 2025 at 11:15 PM Luis Chamberlain <mcgrof@kernel.org>
> > wrote:
> > >
> > > > There's a fix for this already in next
> > > >
> > >
> > > Oh? Which commit?
> >
> > Oh seems linux-next hasn't been updated in a few days, so you can try
> > this patch:
> >
> > https://lore.kernel.org/all/20250307020403.3068567-1-mcgrof@kernel.org/
>
>
> --- a/block/bdev.c
> +++ b/block/bdev.c
> @@ -181,6 +181,8 @@ EXPORT_SYMBOL(set_blocksize);
>
> int sb_set_blocksize(struct super_block *sb, int size)
> {
> + if (!(sb->s_type->fs_flags & FS_LBS) && size > PAGE_SIZE)
> + return 0;
> if (set_blocksize(sb->s_bdev_file, size))
> return 0;
> ...
>
>
> Thanks, but looking at the code change, seems filesystems with FS_LBS
> (e.g., bcachefs, XFS) can still mount larger block sizes properly. IOW,
> the test ioctl_loop06 still failed on RHEL9 (XFS) platform.
The test does not fail because the filesystem being used, the test fails
because it expects setting the block size > PAGE_SIZE will fail for the
loop back device it is creating and then setting the block size for it.
There are two tests which fail:
* set block size > PAGE_SIZE with LOOP_SET_BLOCK_SIZE
* set block size > PAGE_SIZE with LOOP_CONFIGURE
It expects to fail. The new work enables the block layer to support
block sizes > PAGE_SIZE on block devices, essentially that the logical
or physical block size can be > PAGE_SIZE. That is supported now.
> Is that expected? Or, should we adjust the testcase for FS with FS_LBS
> as exception?
Contrary to filesystems, block drivers use now implicitly use
blk_validate_limits() through queue_limits_commit_update to validate
queue limits, but PAGE_SIZE is no longer an issue. In the loop back driver
case we have then:
ioctl LOOP_CONFIGURE --> loop_configure()
lim = queue_limits_start_update(lo->lo_queue);
loop_update_limits(lo, &lim, config->block_size);
ioctl LOOP_SET_BLOCK_SIZE --> loop_set_block_size()
lim = queue_limits_start_update(lo->lo_queue);
loop_update_limits(lo, &lim, arg);
I don't see anything wrong with the loop driver supporting logical block
sizes > PAGE_SIZE, from a quick look, but it does not matter. If tests
exists which are verifying you *can't* do it, then we're bound to get
other similar reports. queue_limits_commit_update() calls
blk_validate_block_size. I just sent a fix.
Thanks for the report.
Luis
More information about the ltp
mailing list