Skip to contentSkip to conversation

47dd675323: ltp.ioctl_loop06.fail

linux-next:master kernel test robot 4 participants 7 messages Mar 10, 2025 – Mar 12, 2025 Block layer

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

Hello,

kernel test robot noticed "ltp.ioctl_loop06.fail" on:

commit: 47dd67532303803a87f43195e088b3b4bcf0454d ("block/bdev: lift block size restrictions to 64k")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

in testcase: ltp
version: ltp-x86_64-0f9d817a3-1_20250222
with following parameters:

	disk: 1HDD
	fs: xfs
	test: syscalls-01/ioctl_loop06

config: x86_64-rhel-9.4-ltp
compiler: gcc-12
test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz (Ivy Bridge) with 8G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]

Running tests.......
<<<test_start>>>
tag=ioctl_loop06 stime=1741322388
cmdline="ioctl_loop06"
contacts=""
analysis=exit
<<<test_output>>>
tst_tmpdir.c:316: TINFO: Using /fs/sda2/tmpdir/ltp-f5uEC1THVm/LTP_iocbBycpj as tmpdir (xfs filesystem) tst_test.c:1900: TINFO: LTP version: 20250130-118-g0f9d817a3
tst_test.c:1904: TINFO: Tested kernel: 6.14.0-rc1-00007-g47dd67532303 #1 SMP PREEMPT_DYNAMIC Fri Mar 7 11:25:50 CST 2025 x86_64 tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:676: TINFO: CONFIG_KASAN kernel option detected which might slow the execution tst_test.c:1722: TINFO: Overall timeout per run is 0h 10m 00s
tst_device.c:97: TINFO: Found free device 0 '/dev/loop0'
ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg < 512
ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22)
ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg > PAGE_SIZE
ioctl_loop06.c:57: TFAIL: Set block size succeed unexpectedly
ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg != power_of_2
ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22)
ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size < 512
ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22)
ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size > PAGE_SIZE
ioctl_loop06.c:57: TFAIL: Set block size succeed unexpectedly
ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size != power_of_2
ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22)

Summary:

passed   4
failed   2
broken   0
skipped  0

warnings 0
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=1 corefile=no cutime=0 cstime=6
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20250130-118-g0f9d817a3

       ###############################################################

            Done executing testcases.
            LTP Version:  20250130-118-g0f9d817a3
       ###############################################################

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20250310/[email protected]

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw

Hi,

The ioctl_loop06 test expects PAGE_SIZE to be the upper limit, but the kernel
now allows up to 64K (SZ_64K). If PAGE_SIZE < 64K (e.g., 4K on x86), the test wrongly assumes anything above PAGE_SIZE should be rejected, but the kernel now allows up to 64K.

I guess we probably need to adjust testcase to dynamically define an EXPECTED_MAX_BLOCK_SIZE according to kernel versions.
I will send out a patch to LTP ML.

Quoted 108 lines · kernel test robot

Hello,

kernel test robot noticed "ltp.ioctl_loop06.fail" on:

commit: 47dd67532303803a87f43195e088b3b4bcf0454d ("block/bdev: lift block size restrictions to 64k")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

in testcase: ltp
version: ltp-x86_64-0f9d817a3-1_20250222
with following parameters:

        disk: 1HDD
        fs: xfs
        test: syscalls-01/ioctl_loop06

config: x86_64-rhel-9.4-ltp
compiler: gcc-12
test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz (Ivy Bridge) with 8G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes:
https://lore.kernel.org/oe-lkp/[email protected]

Running tests.......
<<<test_start>>>
tag=ioctl_loop06 stime=1741322388
cmdline="ioctl_loop06"
contacts=""
analysis=exit
<<<test_output>>>
tst_tmpdir.c:316: TINFO: Using /fs/sda2/tmpdir/ltp-f5uEC1THVm/LTP_iocbBycpj as tmpdir (xfs filesystem) tst_test.c:1900: TINFO: LTP version: 20250130-118-g0f9d817a3 tst_test.c:1904: TINFO: Tested kernel: 6.14.0-rc1-00007-g47dd67532303 #1 SMP PREEMPT_DYNAMIC Fri Mar 7 11:25:50 CST 2025 x86_64 tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz' tst_kconfig.c:676: TINFO: CONFIG_KASAN kernel option detected which might slow the execution
tst_test.c:1722: TINFO: Overall timeout per run is 0h 10m 00s tst_device.c:97: TINFO: Found free device 0 '/dev/loop0' ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg < 512 ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg > PAGE_SIZE ioctl_loop06.c:57: TFAIL: Set block size succeed unexpectedly ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg != power_of_2 ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size < 512 ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size > PAGE_SIZE ioctl_loop06.c:57: TFAIL: Set block size succeed unexpectedly ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size != power_of_2
ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22)

Summary:

passed   4
failed   2
broken   0
skipped  0

warnings 0
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=1 corefile=no cutime=0 cstime=6
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20250130-118-g0f9d817a3

       ###############################################################

            Done executing testcases.
            LTP Version:  20250130-118-g0f9d817a3
       ###############################################################

The kernel config and materials to reproduce are available at:

https://download.01.org/0day-ci/archive/20250310/[email protected]

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

There's a fix for this already in next

Quoted 130 lines · Li Wang

Hi,

The ioctl_loop06 test expects PAGE_SIZE to be the upper limit, but the kernel
now allows up to 64K (SZ_64K). If PAGE_SIZE < 64K (e.g., 4K on x86), the test wrongly assumes anything above PAGE_SIZE should be rejected, but the kernel now allows up to 64K.

I guess we probably need to adjust testcase to dynamically define an EXPECTED_MAX_BLOCK_SIZE according to kernel versions.
I will send out a patch to LTP ML.

Quoted 99 lines · kernel test robot

Hello,

kernel test robot noticed "ltp.ioctl_loop06.fail" on:

commit: 47dd67532303803a87f43195e088b3b4bcf0454d ("block/bdev: lift block size restrictions to 64k")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

in testcase: ltp
version: ltp-x86_64-0f9d817a3-1_20250222
with following parameters:

        disk: 1HDD
        fs: xfs
        test: syscalls-01/ioctl_loop06

config: x86_64-rhel-9.4-ltp
compiler: gcc-12
test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz (Ivy Bridge) with 8G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes:
https://lore.kernel.org/oe-lkp/[email protected]

Running tests.......
<<<test_start>>>
tag=ioctl_loop06 stime=1741322388
cmdline="ioctl_loop06"
contacts=""
analysis=exit
<<<test_output>>>
tst_tmpdir.c:316: TINFO: Using /fs/sda2/tmpdir/ltp-f5uEC1THVm/LTP_iocbBycpj as tmpdir (xfs filesystem) tst_test.c:1900: TINFO: LTP version: 20250130-118-g0f9d817a3 tst_test.c:1904: TINFO: Tested kernel: 6.14.0-rc1-00007-g47dd67532303 #1 SMP PREEMPT_DYNAMIC Fri Mar 7 11:25:50 CST 2025 x86_64 tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz' tst_kconfig.c:676: TINFO: CONFIG_KASAN kernel option detected which might slow the execution
tst_test.c:1722: TINFO: Overall timeout per run is 0h 10m 00s tst_device.c:97: TINFO: Found free device 0 '/dev/loop0' ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg < 512 ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg > PAGE_SIZE ioctl_loop06.c:57: TFAIL: Set block size succeed unexpectedly ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg != power_of_2 ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size < 512 ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size > PAGE_SIZE ioctl_loop06.c:57: TFAIL: Set block size succeed unexpectedly ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size != power_of_2
ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22)

Summary:

passed   4
failed   2
broken   0
skipped  0

warnings 0
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=1 corefile=no cutime=0 cstime=6
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20250130-118-g0f9d817a3

       ###############################################################

            Done executing testcases.
            LTP Version:  20250130-118-g0f9d817a3
       ###############################################################

The kernel config and materials to reproduce are available at:

https://download.01.org/0day-ci/archive/20250310/[email protected]

Quoted 9 lines

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

--
Mailing list info: https://lists.linux.it/listinfo/ltp

--
Regards,
Li Wang

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw
Quoted 2 lines · Luis Chamberlain

There's a fix for this already in next

Oh? Which commit?

Quoted 135 lines · Li Wang
Quoted 133 lines

Hi,

The ioctl_loop06 test expects PAGE_SIZE to be the upper limit, but the kernel
now allows up to 64K (SZ_64K). If PAGE_SIZE < 64K (e.g., 4K on x86), the test wrongly assumes anything above PAGE_SIZE should be rejected, but the kernel now allows up to 64K.

I guess we probably need to adjust testcase to dynamically define an EXPECTED_MAX_BLOCK_SIZE according to kernel versions.
I will send out a patch to LTP ML.

Quoted 101 lines · kernel test robot

Hello,

kernel test robot noticed "ltp.ioctl_loop06.fail" on:

commit: 47dd67532303803a87f43195e088b3b4bcf0454d ("block/bdev: lift block size restrictions to 64k")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

in testcase: ltp
version: ltp-x86_64-0f9d817a3-1_20250222
with following parameters:

        disk: 1HDD
        fs: xfs
        test: syscalls-01/ioctl_loop06

config: x86_64-rhel-9.4-ltp
compiler: gcc-12
test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz (Ivy Bridge) with 8G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes:
https://lore.kernel.org/oe-lkp/[email protected]

Running tests.......
<<<test_start>>>
tag=ioctl_loop06 stime=1741322388
cmdline="ioctl_loop06"
contacts=""
analysis=exit
<<<test_output>>>
tst_tmpdir.c:316: TINFO: Using /fs/sda2/tmpdir/ltp-f5uEC1THVm/LTP_iocbBycpj as tmpdir (xfs filesystem) tst_test.c:1900: TINFO: LTP version: 20250130-118-g0f9d817a3 tst_test.c:1904: TINFO: Tested kernel: 6.14.0-rc1-00007-g47dd67532303 #1 SMP PREEMPT_DYNAMIC Fri Mar 7 11:25:50 CST 2025 x86_64 tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz' tst_kconfig.c:676: TINFO: CONFIG_KASAN kernel option detected which might slow the execution
tst_test.c:1722: TINFO: Overall timeout per run is 0h 10m 00s tst_device.c:97: TINFO: Found free device 0 '/dev/loop0' ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg < 512 ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg > PAGE_SIZE ioctl_loop06.c:57: TFAIL: Set block size succeed unexpectedly ioctl_loop06.c:74: TINFO: Using LOOP_SET_BLOCK_SIZE with arg != power_of_2
ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size < 512 ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22) ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size > PAGE_SIZE
ioctl_loop06.c:57: TFAIL: Set block size succeed unexpectedly ioctl_loop06.c:74: TINFO: Using LOOP_CONFIGURE with block_size != power_of_2
ioctl_loop06.c:65: TPASS: Set block size failed as expected: EINVAL (22)

Summary:

passed   4
failed   2
broken   0
skipped  0

warnings 0
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=1 termination_type=exited termination_id=1 corefile=no cutime=0 cstime=6
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20250130-118-g0f9d817a3

       ###############################################################

            Done executing testcases.
            LTP Version:  20250130-118-g0f9d817a3
       ###############################################################

The kernel config and materials to reproduce are available at:

https://download.01.org/0day-ci/archive/20250310/[email protected]

Quoted 9 lines

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

--
Mailing list info: https://lists.linux.it/listinfo/ltp

--
Regards,
Li Wang

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw
Quoted 7 lines · Luis Chamberlain
Quoted 1 line · Li Wang

On Mon, Mar 10, 2025 at 11:15 PM Luis Chamberlain <[email protected]>

Quoted 4 lines · wrote:
Quoted 3 lines

There's a fix for this already in next

Quoted 6 lines
Quoted 1 line

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/[email protected]/

block/bdev.c +2 -0
@@ -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.

Is that expected? Or, should we adjust the testcase for FS with FS_LBS as exception?

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#6 lore raw
Quoted 30 lines · Li Wang
Quoted 13 lines · Luis Chamberlain
Quoted 1 line · Li Wang

On Mon, Mar 10, 2025 at 11:15 PM Luis Chamberlain <[email protected]>

Quoted 5 lines · wrote:
Quoted 3 lines

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/[email protected]/

block/bdev.c +2 -0
@@ -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;
...
Quoted 3 lines

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.

Quoted 2 lines

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