diff mbox series

[RFC,1/1] ioctl_ficlone03: Require 5.10 for XFS

Message ID 20250321100320.162107-1-pvorel@suse.cz (mailing list archive)
State New
Headers show
Series [RFC,1/1] ioctl_ficlone03: Require 5.10 for XFS | expand

Commit Message

Petr Vorel March 21, 2025, 10:03 a.m. UTC
Test fails on XFS on kernel older than 5.10:

    # ./ioctl_ficlone03
	...
    tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_ioc6ARHZ7/mnt fstyp=xfs flags=0
    [   10.122070] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.
    [   10.123035] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
    [   10.123916] XFS (loop0): SB validate failed with error -22.
    tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)

This also causes Btrfs testing to be skipped due TBROK on XFS. With increased version we get on 5.4 LTS:

    # ./ioctl_ficlone03
    tst_test.c:1904: TINFO: Tested kernel: 5.4.291 #194 SMP Fri Mar 21 10:18:02 CET 2025 x86_64
    ...
    tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
    tst_test.c:1833: TINFO: === Testing on xfs ===
    tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
    tst_test.c:969: TCONF: The test requires kernel 5.10 or newer
    tst_test.c:1833: TINFO: === Testing on btrfs ===
    tst_test.c:1170: TINFO: Formatting /dev/loop0 with btrfs opts='' extra opts=''
    [   30.143670] BTRFS: device fsid 1a6d250c-0636-11f0-850f-c598bdcd84c4 devid 1 transid 6 /dev/loop0
    tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocjwzyal/mnt fstyp=btrfs flags=0
    [   30.156563] BTRFS info (device loop0): using crc32c (crc32c-generic) checksum algorithm
    [   30.157363] BTRFS info (device loop0): flagging fs with big metadata feature
    [   30.158061] BTRFS info (device loop0): using free space tree
    [   30.158620] BTRFS info (device loop0): has skinny extents
    [   30.159911] BTRFS info (device loop0): enabling ssd optimizations
    [   30.160652] BTRFS info (device loop0): checking UUID tree
    ioctl_ficlone03_fix.c:49: TPASS: invalid source : EBADF (9)
    ioctl_ficlone03_fix.c:55: TPASS: invalid source : EBADF (9)

Fixing commit is 29887a2271319 ("xfs: enable big timestamps").

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi all,

I suppose we aren't covering a test bug with this and test is really
wrong expecting 4.16 would work on XFS. FYI this affects 5.4.291
(latest 5.4 LTS which is still supported) and would not be fixed due a
lot of missing functionality from 5.10.

Kind regards,
Petr

 testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrea Cervesato March 21, 2025, 10:40 a.m. UTC | #1
Hi Petr,

thanks for checking and finding the issue of the test, it was really 
helpful.
Acked-by: Andrea Cervesato <andrea.cervesato@suse.com>

Kind regards,
Andrea Cervesato

On 3/21/25 11:03, Petr Vorel wrote:
> Test fails on XFS on kernel older than 5.10:
>
>      # ./ioctl_ficlone03
> 	...
>      tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_ioc6ARHZ7/mnt fstyp=xfs flags=0
>      [   10.122070] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.
>      [   10.123035] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
>      [   10.123916] XFS (loop0): SB validate failed with error -22.
>      tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)
>
> This also causes Btrfs testing to be skipped due TBROK on XFS. With increased version we get on 5.4 LTS:
>
>      # ./ioctl_ficlone03
>      tst_test.c:1904: TINFO: Tested kernel: 5.4.291 #194 SMP Fri Mar 21 10:18:02 CET 2025 x86_64
>      ...
>      tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
>      tst_test.c:1833: TINFO: === Testing on xfs ===
>      tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
>      tst_test.c:969: TCONF: The test requires kernel 5.10 or newer
>      tst_test.c:1833: TINFO: === Testing on btrfs ===
>      tst_test.c:1170: TINFO: Formatting /dev/loop0 with btrfs opts='' extra opts=''
>      [   30.143670] BTRFS: device fsid 1a6d250c-0636-11f0-850f-c598bdcd84c4 devid 1 transid 6 /dev/loop0
>      tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocjwzyal/mnt fstyp=btrfs flags=0
>      [   30.156563] BTRFS info (device loop0): using crc32c (crc32c-generic) checksum algorithm
>      [   30.157363] BTRFS info (device loop0): flagging fs with big metadata feature
>      [   30.158061] BTRFS info (device loop0): using free space tree
>      [   30.158620] BTRFS info (device loop0): has skinny extents
>      [   30.159911] BTRFS info (device loop0): enabling ssd optimizations
>      [   30.160652] BTRFS info (device loop0): checking UUID tree
>      ioctl_ficlone03_fix.c:49: TPASS: invalid source : EBADF (9)
>      ioctl_ficlone03_fix.c:55: TPASS: invalid source : EBADF (9)
>
> Fixing commit is 29887a2271319 ("xfs: enable big timestamps").
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi all,
>
> I suppose we aren't covering a test bug with this and test is really
> wrong expecting 4.16 would work on XFS. FYI this affects 5.4.291
> (latest 5.4 LTS which is still supported) and would not be fixed due a
> lot of missing functionality from 5.10.
>
> Kind regards,
> Petr
>
>   testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> index 6a9d270d9f..e2ab10cba1 100644
> --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> @@ -113,7 +113,7 @@ static struct tst_test test = {
>   		{.type = "bcachefs"},
>   		{
>   			.type = "xfs",
> -			.min_kver = "4.16",
> +			.min_kver = "5.10",
>   			.mkfs_ver = "mkfs.xfs >= 1.5.0",
>   			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
>   		},
Darrick J. Wong March 21, 2025, 3:23 p.m. UTC | #2
On Fri, Mar 21, 2025 at 11:03:20AM +0100, Petr Vorel wrote:
> Test fails on XFS on kernel older than 5.10:
> 
>     # ./ioctl_ficlone03
> 	...
>     tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_ioc6ARHZ7/mnt fstyp=xfs flags=0
>     [   10.122070] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.

0x8 is XFS_SB_FEAT_INCOMPAT_BIGTIME, maybe you need to format with a set
of filesystem features compatible with 5.10?

# mkfs.xfs -c options=/usr/share/xfsprogs/mkfs/lts_5.10.conf /dev/sda1

--D

>     [   10.123035] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
>     [   10.123916] XFS (loop0): SB validate failed with error -22.
>     tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)
> 
> This also causes Btrfs testing to be skipped due TBROK on XFS. With increased version we get on 5.4 LTS:
> 
>     # ./ioctl_ficlone03
>     tst_test.c:1904: TINFO: Tested kernel: 5.4.291 #194 SMP Fri Mar 21 10:18:02 CET 2025 x86_64
>     ...
>     tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
>     tst_test.c:1833: TINFO: === Testing on xfs ===
>     tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
>     tst_test.c:969: TCONF: The test requires kernel 5.10 or newer
>     tst_test.c:1833: TINFO: === Testing on btrfs ===
>     tst_test.c:1170: TINFO: Formatting /dev/loop0 with btrfs opts='' extra opts=''
>     [   30.143670] BTRFS: device fsid 1a6d250c-0636-11f0-850f-c598bdcd84c4 devid 1 transid 6 /dev/loop0
>     tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocjwzyal/mnt fstyp=btrfs flags=0
>     [   30.156563] BTRFS info (device loop0): using crc32c (crc32c-generic) checksum algorithm
>     [   30.157363] BTRFS info (device loop0): flagging fs with big metadata feature
>     [   30.158061] BTRFS info (device loop0): using free space tree
>     [   30.158620] BTRFS info (device loop0): has skinny extents
>     [   30.159911] BTRFS info (device loop0): enabling ssd optimizations
>     [   30.160652] BTRFS info (device loop0): checking UUID tree
>     ioctl_ficlone03_fix.c:49: TPASS: invalid source : EBADF (9)
>     ioctl_ficlone03_fix.c:55: TPASS: invalid source : EBADF (9)
> 
> Fixing commit is 29887a2271319 ("xfs: enable big timestamps").
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi all,
> 
> I suppose we aren't covering a test bug with this and test is really
> wrong expecting 4.16 would work on XFS. FYI this affects 5.4.291
> (latest 5.4 LTS which is still supported) and would not be fixed due a
> lot of missing functionality from 5.10.
> 
> Kind regards,
> Petr
> 
>  testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> index 6a9d270d9f..e2ab10cba1 100644
> --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> @@ -113,7 +113,7 @@ static struct tst_test test = {
>  		{.type = "bcachefs"},
>  		{
>  			.type = "xfs",
> -			.min_kver = "4.16",
> +			.min_kver = "5.10",
>  			.mkfs_ver = "mkfs.xfs >= 1.5.0",
>  			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
>  		},
> -- 
> 2.47.2
> 
>
Petr Vorel March 21, 2025, 4:06 p.m. UTC | #3
> On Fri, Mar 21, 2025 at 11:03:20AM +0100, Petr Vorel wrote:
> > Test fails on XFS on kernel older than 5.10:

> >     # ./ioctl_ficlone03
> > 	...
> >     tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_ioc6ARHZ7/mnt fstyp=xfs flags=0
> >     [   10.122070] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.

> 0x8 is XFS_SB_FEAT_INCOMPAT_BIGTIME, maybe you need to format with a set
> of filesystem features compatible with 5.10?

> # mkfs.xfs -c options=/usr/share/xfsprogs/mkfs/lts_5.10.conf /dev/sda1

Yes, XFS_SB_FEAT_INCOMPAT_BIGTIME is what is missing for the test. Device is
formatted with: -m reflink=1 (I'm sorry to not posting this before):

tst_test.c:1170: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=1' extra opts=''

I thought it would imply XFS_SB_FEAT_INCOMPAT_BIGTIME, but when I tried to remove it
it did not help:

tst_test.c:1909: TINFO: Tested kernel: 5.0.21-00005-gb6c47615d7bf #211 SMP Fri Mar 21 12:23:18 CET 2025 x86_64
...
tst_test.c:1833: TINFO: === Testing on xfs ===
tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
tst_test.c:1170: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''
tst_test.c:1183: TINFO: Mounting /dev[   75.418676] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.
/loop0 to /tmp/L[   75.419683] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
TP_iocO8VAIk/mnt[   75.420629] XFS (loop0): SB validate failed with error -22.
 fstyp=xfs flags=0
tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)

Well, I tried with mkfs.xfs from openSUSE Leap 15.6 (tested via rapido-linux),
probably the defaults add it.

$ mkfs.xfs -V
mkfs.xfs version 6.7.0

Also I noted that test works on our 5.3.18 based SLES15-SP2 with xfsprogs
4.15.0. Maybe I'm just wasting your time with wrong patch.

Kind regards,
Petr

> --D

> >     [   10.123035] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
> >     [   10.123916] XFS (loop0): SB validate failed with error -22.
> >     tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)

> > This also causes Btrfs testing to be skipped due TBROK on XFS. With increased version we get on 5.4 LTS:

> >     # ./ioctl_ficlone03
> >     tst_test.c:1904: TINFO: Tested kernel: 5.4.291 #194 SMP Fri Mar 21 10:18:02 CET 2025 x86_64
> >     ...
> >     tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
> >     tst_test.c:1833: TINFO: === Testing on xfs ===
> >     tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
> >     tst_test.c:969: TCONF: The test requires kernel 5.10 or newer
> >     tst_test.c:1833: TINFO: === Testing on btrfs ===
> >     tst_test.c:1170: TINFO: Formatting /dev/loop0 with btrfs opts='' extra opts=''
> >     [   30.143670] BTRFS: device fsid 1a6d250c-0636-11f0-850f-c598bdcd84c4 devid 1 transid 6 /dev/loop0
> >     tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocjwzyal/mnt fstyp=btrfs flags=0
> >     [   30.156563] BTRFS info (device loop0): using crc32c (crc32c-generic) checksum algorithm
> >     [   30.157363] BTRFS info (device loop0): flagging fs with big metadata feature
> >     [   30.158061] BTRFS info (device loop0): using free space tree
> >     [   30.158620] BTRFS info (device loop0): has skinny extents
> >     [   30.159911] BTRFS info (device loop0): enabling ssd optimizations
> >     [   30.160652] BTRFS info (device loop0): checking UUID tree
> >     ioctl_ficlone03_fix.c:49: TPASS: invalid source : EBADF (9)
> >     ioctl_ficlone03_fix.c:55: TPASS: invalid source : EBADF (9)

> > Fixing commit is 29887a2271319 ("xfs: enable big timestamps").

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > Hi all,

> > I suppose we aren't covering a test bug with this and test is really
> > wrong expecting 4.16 would work on XFS. FYI this affects 5.4.291
> > (latest 5.4 LTS which is still supported) and would not be fixed due a
> > lot of missing functionality from 5.10.

> > Kind regards,
> > Petr

> >  testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)

> > diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > index 6a9d270d9f..e2ab10cba1 100644
> > --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > @@ -113,7 +113,7 @@ static struct tst_test test = {
> >  		{.type = "bcachefs"},
> >  		{
> >  			.type = "xfs",
> > -			.min_kver = "4.16",
> > +			.min_kver = "5.10",
> >  			.mkfs_ver = "mkfs.xfs >= 1.5.0",
> >  			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
> >  		},
> > -- 
> > 2.47.2
Darrick J. Wong March 21, 2025, 4:18 p.m. UTC | #4
On Fri, Mar 21, 2025 at 05:06:33PM +0100, Petr Vorel wrote:
> > On Fri, Mar 21, 2025 at 11:03:20AM +0100, Petr Vorel wrote:
> > > Test fails on XFS on kernel older than 5.10:
> 
> > >     # ./ioctl_ficlone03
> > > 	...
> > >     tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_ioc6ARHZ7/mnt fstyp=xfs flags=0
> > >     [   10.122070] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.
> 
> > 0x8 is XFS_SB_FEAT_INCOMPAT_BIGTIME, maybe you need to format with a set
> > of filesystem features compatible with 5.10?
> 
> > # mkfs.xfs -c options=/usr/share/xfsprogs/mkfs/lts_5.10.conf /dev/sda1
> 
> Yes, XFS_SB_FEAT_INCOMPAT_BIGTIME is what is missing for the test. Device is
> formatted with: -m reflink=1 (I'm sorry to not posting this before):

You could remove reflink=1 from the test specification, reflink has been
on by default for quite a while now...

> 
> tst_test.c:1170: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=1' extra opts=''
> 
> I thought it would imply XFS_SB_FEAT_INCOMPAT_BIGTIME, but when I tried to remove it
> it did not help:
> 
> tst_test.c:1909: TINFO: Tested kernel: 5.0.21-00005-gb6c47615d7bf #211 SMP Fri Mar 21 12:23:18 CET 2025 x86_64
> ...
> tst_test.c:1833: TINFO: === Testing on xfs ===
> tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
> tst_test.c:1170: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''
> tst_test.c:1183: TINFO: Mounting /dev[   75.418676] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.
> /loop0 to /tmp/L[   75.419683] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
> TP_iocO8VAIk/mnt[   75.420629] XFS (loop0): SB validate failed with error -22.
>  fstyp=xfs flags=0
> tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)
> 
> Well, I tried with mkfs.xfs from openSUSE Leap 15.6 (tested via rapido-linux),
> probably the defaults add it.
> 
> $ mkfs.xfs -V
> mkfs.xfs version 6.7.0

...but mkfs.xfs 6.7 enables y2038 support by default unless you specify
otherwise, which is why it still won't mount.  Hence my suggestion to
use the config files if they're available.  If not, then either run
xfsprogs 5.10 on kernel 5.10, or create per-kernel xfs opts that
override the defaults to put them back down to whatever were the mkfs
defaults in 5.10.

> Also I noted that test works on our 5.3.18 based SLES15-SP2 with xfsprogs
> 4.15.0. Maybe I'm just wasting your time with wrong patch.

<shrug> QA configuration for a bunch of kernels is irritatingly hard,
we all need to compare notes when we can. :)

--D

> Kind regards,
> Petr
> 
> > --D
> 
> > >     [   10.123035] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
> > >     [   10.123916] XFS (loop0): SB validate failed with error -22.
> > >     tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)
> 
> > > This also causes Btrfs testing to be skipped due TBROK on XFS. With increased version we get on 5.4 LTS:
> 
> > >     # ./ioctl_ficlone03
> > >     tst_test.c:1904: TINFO: Tested kernel: 5.4.291 #194 SMP Fri Mar 21 10:18:02 CET 2025 x86_64
> > >     ...
> > >     tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
> > >     tst_test.c:1833: TINFO: === Testing on xfs ===
> > >     tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
> > >     tst_test.c:969: TCONF: The test requires kernel 5.10 or newer
> > >     tst_test.c:1833: TINFO: === Testing on btrfs ===
> > >     tst_test.c:1170: TINFO: Formatting /dev/loop0 with btrfs opts='' extra opts=''
> > >     [   30.143670] BTRFS: device fsid 1a6d250c-0636-11f0-850f-c598bdcd84c4 devid 1 transid 6 /dev/loop0
> > >     tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocjwzyal/mnt fstyp=btrfs flags=0
> > >     [   30.156563] BTRFS info (device loop0): using crc32c (crc32c-generic) checksum algorithm
> > >     [   30.157363] BTRFS info (device loop0): flagging fs with big metadata feature
> > >     [   30.158061] BTRFS info (device loop0): using free space tree
> > >     [   30.158620] BTRFS info (device loop0): has skinny extents
> > >     [   30.159911] BTRFS info (device loop0): enabling ssd optimizations
> > >     [   30.160652] BTRFS info (device loop0): checking UUID tree
> > >     ioctl_ficlone03_fix.c:49: TPASS: invalid source : EBADF (9)
> > >     ioctl_ficlone03_fix.c:55: TPASS: invalid source : EBADF (9)
> 
> > > Fixing commit is 29887a2271319 ("xfs: enable big timestamps").
> 
> > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > ---
> > > Hi all,
> 
> > > I suppose we aren't covering a test bug with this and test is really
> > > wrong expecting 4.16 would work on XFS. FYI this affects 5.4.291
> > > (latest 5.4 LTS which is still supported) and would not be fixed due a
> > > lot of missing functionality from 5.10.
> 
> > > Kind regards,
> > > Petr
> 
> > >  testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> > > diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > > index 6a9d270d9f..e2ab10cba1 100644
> > > --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > > +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > > @@ -113,7 +113,7 @@ static struct tst_test test = {
> > >  		{.type = "bcachefs"},
> > >  		{
> > >  			.type = "xfs",
> > > -			.min_kver = "4.16",
> > > +			.min_kver = "5.10",
> > >  			.mkfs_ver = "mkfs.xfs >= 1.5.0",
> > >  			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
> > >  		},
> > > -- 
> > > 2.47.2
> 
> 
>
Petr Vorel March 24, 2025, 11:32 a.m. UTC | #5
Hi Darrick, all,

> On Fri, Mar 21, 2025 at 05:06:33PM +0100, Petr Vorel wrote:
> > > On Fri, Mar 21, 2025 at 11:03:20AM +0100, Petr Vorel wrote:
> > > > Test fails on XFS on kernel older than 5.10:

> > > >     # ./ioctl_ficlone03
> > > > 	...
> > > >     tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_ioc6ARHZ7/mnt fstyp=xfs flags=0
> > > >     [   10.122070] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.

> > > 0x8 is XFS_SB_FEAT_INCOMPAT_BIGTIME, maybe you need to format with a set
> > > of filesystem features compatible with 5.10?

> > > # mkfs.xfs -c options=/usr/share/xfsprogs/mkfs/lts_5.10.conf /dev/sda1

> > Yes, XFS_SB_FEAT_INCOMPAT_BIGTIME is what is missing for the test. Device is
> > formatted with: -m reflink=1 (I'm sorry to not posting this before):

> You could remove reflink=1 from the test specification, reflink has been
> on by default for quite a while now...

Thanks for a hint. I guess reflink was added in a5132d9b [1] in v4.9.0-rc1 with
default 0 and updated to default 1 in 23069a93 [2] in v4.11.0-rc2.
Unfortunately we still support testing current LTP with kernel up to old 4.4,
therefore we need to keep this until we raise the support to kernel >= 4.11.

[1] https://web.git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=a5132d9b3634fb6436d1f06642ceda82e64ea2f5
[2] https://web.git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=23069a9353eb8af30f3427feed6c92380d025a53

> > tst_test.c:1170: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=1' extra opts=''

> > I thought it would imply XFS_SB_FEAT_INCOMPAT_BIGTIME, but when I tried to remove it
> > it did not help:

> > tst_test.c:1909: TINFO: Tested kernel: 5.0.21-00005-gb6c47615d7bf #211 SMP Fri Mar 21 12:23:18 CET 2025 x86_64
> > ...
> > tst_test.c:1833: TINFO: === Testing on xfs ===
> > tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
> > tst_test.c:1170: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''
> > tst_test.c:1183: TINFO: Mounting /dev[   75.418676] XFS (loop0): Superblock has unknown incompatible features (0x8) enabled.
> > /loop0 to /tmp/L[   75.419683] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
> > TP_iocO8VAIk/mnt[   75.420629] XFS (loop0): SB validate failed with error -22.
> >  fstyp=xfs flags=0
> > tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)

> > Well, I tried with mkfs.xfs from openSUSE Leap 15.6 (tested via rapido-linux),
> > probably the defaults add it.

> > $ mkfs.xfs -V
> > mkfs.xfs version 6.7.0

> ...but mkfs.xfs 6.7 enables y2038 support by default unless you specify
> otherwise, which is why it still won't mount.  Hence my suggestion to
> use the config files if they're available.  If not, then either run
> xfsprogs 5.10 on kernel 5.10, or create per-kernel xfs opts that
> override the defaults to put them back down to whatever were the mkfs
> defaults in 5.10.

Yeah. For bisecting next time I'll tweak LTP to use config file.  I see you
started with 4.19 to support these configs in repo [3] end even install them
/usr/share/xfsprogs/mkfs/. Great. I just need to pass a correct file.

BTW it'd be nice to have way to mkfs.xfs to print this file under new getopt.

[3] https://web.git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/mkfs

> > Also I noted that test works on our 5.3.18 based SLES15-SP2 with xfsprogs
> > 4.15.0. Maybe I'm just wasting your time with wrong patch.

> <shrug> QA configuration for a bunch of kernels is irritatingly hard,
> we all need to compare notes when we can. :)

Thanks!

Kind regards,
Petr

> --D

> > Kind regards,
> > Petr

> > > --D

> > > >     [   10.123035] XFS (loop0): Filesystem cannot be safely mounted by this kernel.
> > > >     [   10.123916] XFS (loop0): SB validate failed with error -22.
> > > >     tst_test.c:1183: TBROK: mount(/dev/loop0, mnt, xfs, 0, (nil)) failed: EINVAL (22)

> > > > This also causes Btrfs testing to be skipped due TBROK on XFS. With increased version we get on 5.4 LTS:

> > > >     # ./ioctl_ficlone03
> > > >     tst_test.c:1904: TINFO: Tested kernel: 5.4.291 #194 SMP Fri Mar 21 10:18:02 CET 2025 x86_64
> > > >     ...
> > > >     tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs
> > > >     tst_test.c:1833: TINFO: === Testing on xfs ===
> > > >     tst_cmd.c:281: TINFO: Parsing mkfs.xfs version
> > > >     tst_test.c:969: TCONF: The test requires kernel 5.10 or newer
> > > >     tst_test.c:1833: TINFO: === Testing on btrfs ===
> > > >     tst_test.c:1170: TINFO: Formatting /dev/loop0 with btrfs opts='' extra opts=''
> > > >     [   30.143670] BTRFS: device fsid 1a6d250c-0636-11f0-850f-c598bdcd84c4 devid 1 transid 6 /dev/loop0
> > > >     tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocjwzyal/mnt fstyp=btrfs flags=0
> > > >     [   30.156563] BTRFS info (device loop0): using crc32c (crc32c-generic) checksum algorithm
> > > >     [   30.157363] BTRFS info (device loop0): flagging fs with big metadata feature
> > > >     [   30.158061] BTRFS info (device loop0): using free space tree
> > > >     [   30.158620] BTRFS info (device loop0): has skinny extents
> > > >     [   30.159911] BTRFS info (device loop0): enabling ssd optimizations
> > > >     [   30.160652] BTRFS info (device loop0): checking UUID tree
> > > >     ioctl_ficlone03_fix.c:49: TPASS: invalid source : EBADF (9)
> > > >     ioctl_ficlone03_fix.c:55: TPASS: invalid source : EBADF (9)

> > > > Fixing commit is 29887a2271319 ("xfs: enable big timestamps").

> > > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > > ---
> > > > Hi all,

> > > > I suppose we aren't covering a test bug with this and test is really
> > > > wrong expecting 4.16 would work on XFS. FYI this affects 5.4.291
> > > > (latest 5.4 LTS which is still supported) and would not be fixed due a
> > > > lot of missing functionality from 5.10.

> > > > Kind regards,
> > > > Petr

> > > >  testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)

> > > > diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > > > index 6a9d270d9f..e2ab10cba1 100644
> > > > --- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > > > +++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
> > > > @@ -113,7 +113,7 @@ static struct tst_test test = {
> > > >  		{.type = "bcachefs"},
> > > >  		{
> > > >  			.type = "xfs",
> > > > -			.min_kver = "4.16",
> > > > +			.min_kver = "5.10",
> > > >  			.mkfs_ver = "mkfs.xfs >= 1.5.0",
> > > >  			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
> > > >  		},
> > > > -- 
> > > > 2.47.2
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
index 6a9d270d9f..e2ab10cba1 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_ficlone03.c
@@ -113,7 +113,7 @@  static struct tst_test test = {
 		{.type = "bcachefs"},
 		{
 			.type = "xfs",
-			.min_kver = "4.16",
+			.min_kver = "5.10",
 			.mkfs_ver = "mkfs.xfs >= 1.5.0",
 			.mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
 		},