Skip to contentSkip to conversation

quotactl0{2,3,5,7}.c dependency problems on older kernels

LTP Petr Vorel 2 participants 7 messages Mar 17, 2022 – Mar 18, 2022

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

Hi Xu,

actually quotactl0{2,3,5,7}.c and quotactl03.c fail on only on v4.5:

tst_kconfig.c:82: TINFO: Parsing kernel config '/.config' tst_device.c:88: TINFO: Found free device 0 '/dev/loop0' tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''

[  271.093416] XFS (loop0): Superblock has unknown read-only compatible features (0x4) enabled.
[  271.096902] XFS (loop0): Attempted to mount read-only compatible filesystem read-write.
[  271.100128] XFS (loop0): Filesystem can only be safely mounted read only.
[  271.101852] XFS (loop0): SB validate failed with error -22.

tst_test.c:1010: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d6a0) failed: EINVAL (22)

Tested on config:
grep -e QUOTA -e QFMT /.config
CONFIG_XFS_QUOTA=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y

But not work either on v4.10:

[  299.235456] XFS (loop0): EXPERIMENTAL reflink feature enabled. Use at your own risk!
[  299.239463] XFS (loop0): Mounting V5 Filesystem
[  299.240950] XFS (loop0): Log size 1368 blocks too small, minimum size is 1580 blocks
[  299.243357] XFS (loop0): AAIEEE! Log failed size checks. Abort!
[  299.245183] XFS (loop0): log mount failed

quotactl07.c:58: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d054) failed: EINVAL (22)

(the same config)

Tests use:

all:
.mntpoint = MNTPOINT,

quotactl02.c
.mnt_data = "usrquota,grpquota",

quotactl03.c
.mnt_data = "usrquota",

quotactl05.c
.mnt_data = "prjquota"

quotactl07.c does no specific .mnt_data.
but had .mnt_data = "usrquota" till recently - removed in eb1cd3e922 ("syscalls/quotactl07: Refactor this case")

I guess newer kernel is needed.
But checking usrquota for XFS it has "always" been there - added in a67d7c5f5d25 ("[XFS] Move platform specific mount option parse out of core XFS code") in v2.6.25-rc1

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Re: [LTP] quotactl0{2, 3, 5, 7}.c dependency problems on older kernels

Hi Petr

Quoted 4 lines

Hi Xu,

actually quotactl0{2,3,5,7}.c and quotactl03.c fail on only on v4.5:

Quoted 8 lines

tst_kconfig.c:82: TINFO: Parsing kernel config '/.config' tst_device.c:88: TINFO: Found free device 0 '/dev/loop0' tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''

[  271.093416] XFS (loop0): Superblock has unknown read-only compatible features (0x4) enabled.
[  271.096902] XFS (loop0): Attempted to mount read-only compatible filesystem read-write.
[  271.100128] XFS (loop0): Filesystem can only be safely mounted read only.
[  271.101852] XFS (loop0): SB validate failed with error -22.

tst_test.c:1010: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d6a0) failed: EINVAL (22)

That is because you use a newer xfsprogs (it provides newer mkfs.xfs and enable reflink feature by default[1]). But older kernel can't regcozine this feature bits[2](it supports reflink feature bits since kernel 4.9-rc1), then mount failed.

[1]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=ec1b42e6d58dcb7cfc5de6fc825832944997e176 [2]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=f0ec1b8ef11df0a51954df7e3ff3ca4aadb0d34b

I don't think this is a problem, user should know its kernel version and xfsprogs vesion. Linux distribution has sloved this well except you used yourself compiled kernel.

Quoted 14 lines

Tested on config:
grep -e QUOTA -e QFMT /.config
CONFIG_XFS_QUOTA=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y

Quoted 4 lines

But not work either on v4.10:

[  299.235456] XFS (loop0): EXPERIMENTAL reflink feature enabled. Use at your own risk!
[  299.239463] XFS (loop0): Mounting V5 Filesystem
[  299.240950] XFS (loop0): Log size 1368 blocks too small, minimum size is 1580 blocks

In xfstests, we use -lsize parameter[3] or use a value then get the correct value from error log[4]. reflink feature will increase log size[5], so we can disable reflink feature by using mkfs.xfs -m reflink=0 /dev/loop0 (it also need mkfs.xfs support, so we may need a mkfs.xfs cmd version check[5], if meet this version, use mkfs.xfs -m reflink=0, if less than this version, we can ignore this version and don't use mkfs.xfs extra option).

Firstly, can you try mkfs.xfs -m reflink=0 way whether fix these two problems?

[3]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?id=7e07c4bebb08414ca8228ea91bdf57828fd4d110 [4]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/common/xfs#n81 [5]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=a5132d9b3634fb6436d1f06642ceda82e64ea2f5

Best Regards
Yang Xu

Quoted 31 lines
[  299.243357] XFS (loop0): AAIEEE! Log failed size checks. Abort!
[  299.245183] XFS (loop0): log mount failed

quotactl07.c:58: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d054) failed: EINVAL (22)

(the same config)

Tests use:

all:
.mntpoint = MNTPOINT,

quotactl02.c
.mnt_data = "usrquota,grpquota",

quotactl03.c
.mnt_data = "usrquota",

quotactl05.c
.mnt_data = "prjquota"

quotactl07.c does no specific .mnt_data.
but had .mnt_data = "usrquota" till recently - removed in eb1cd3e922 ("syscalls/quotactl07: Refactor this case")

I guess newer kernel is needed.
But checking usrquota for XFS it has "always" been there - added in a67d7c5f5d25 ("[XFS] Move platform specific mount option parse out of core XFS code") in v2.6.25-rc1

Kind regards,
Petr

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

Re: [LTP] quotactl0{2, 3, 5, 7}.c dependency problems on older kernels

Hi Petr

Quoted 51 lines

Hi Petr

Quoted 4 lines

Hi Xu,

actually quotactl0{2,3,5,7}.c and quotactl03.c fail on only on v4.5:

Quoted 8 lines

tst_kconfig.c:82: TINFO: Parsing kernel config '/.config' tst_device.c:88: TINFO: Found free device 0 '/dev/loop0' tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''

[  271.093416] XFS (loop0): Superblock has unknown read-only compatible features (0x4) enabled.
[  271.096902] XFS (loop0): Attempted to mount read-only compatible filesystem read-write.
[  271.100128] XFS (loop0): Filesystem can only be safely mounted read only.
[  271.101852] XFS (loop0): SB validate failed with error -22.

tst_test.c:1010: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d6a0) failed: EINVAL (22)

That is because you use a newer xfsprogs (it provides newer mkfs.xfs and enable reflink feature by default[1]). But older kernel can't regcozine this feature bits[2](it supports reflink feature bits since kernel 4.9-rc1), then mount failed.

[1]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=ec1b42e6d58dcb7cfc5de6fc825832944997e176 [2]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=f0ec1b8ef11df0a51954df7e3ff3ca4aadb0d34b

I don't think this is a problem, user should know its kernel version and xfsprogs vesion. Linux distribution has sloved this well except you used yourself compiled kernel.

Quoted 14 lines

Tested on config:
grep -e QUOTA -e QFMT /.config
CONFIG_XFS_QUOTA=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y

Quoted 4 lines

But not work either on v4.10:

[  299.235456] XFS (loop0): EXPERIMENTAL reflink feature enabled. Use at your own risk!
[  299.239463] XFS (loop0): Mounting V5 Filesystem
[  299.240950] XFS (loop0): Log size 1368 blocks too small, minimum size is 1580 blocks

In xfstests, we use -lsize parameter[3] or use a value then get the correct value from error log[4]. reflink feature will increase log size[5], so we can disable reflink feature by using mkfs.xfs -m reflink=0 /dev/loop0 (it also need mkfs.xfs support, so we may need a mkfs.xfs cmd version check[5], if meet this version, use mkfs.xfs -m reflink=0, if less than this version, we can ignore this version and don't use mkfs.xfs extra option).

Quoted 3 lines

Firstly, can you try mkfs.xfs -m reflink=0 way whether fix these two problems?

You can also just increase dev_min_size to 512 to check whether fix this logsize problem.

Best Regards
Yang Xu

Quoted 39 lines

[3]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?id=7e07c4bebb08414ca8228ea91bdf57828fd4d110 [4]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/common/xfs#n81 [5]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=a5132d9b3634fb6436d1f06642ceda82e64ea2f5

Best Regards
Yang Xu

Quoted 31 lines
[  299.243357] XFS (loop0): AAIEEE! Log failed size checks. Abort!
[  299.245183] XFS (loop0): log mount failed

quotactl07.c:58: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d054) failed: EINVAL (22)

(the same config)

Tests use:

all:
.mntpoint = MNTPOINT,

quotactl02.c
.mnt_data = "usrquota,grpquota",

quotactl03.c
.mnt_data = "usrquota",

quotactl05.c
.mnt_data = "prjquota"

quotactl07.c does no specific .mnt_data.
but had .mnt_data = "usrquota" till recently - removed in eb1cd3e922 ("syscalls/quotactl07: Refactor this case")

I guess newer kernel is needed.
But checking usrquota for XFS it has "always" been there - added in a67d7c5f5d25 ("[XFS] Move platform specific mount option parse out of core XFS code") in v2.6.25-rc1

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

Re: [LTP] quotactl0{2, 3, 5, 7}.c dependency problems on older kernels

Hi Xu,

...

Quoted 5 lines
Quoted 2 lines

Firstly, can you try mkfs.xfs -m reflink=0 way whether fix these two problems?

You can also just increase dev_min_size to 512 to check whether fix this logsize problem.

No, using .dev_min_size = 512 (and removing .dev_fs_opts "-m reflink=0") does not help (fails as without any fix).

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#4 lore raw

Re: [LTP] quotactl0{2, 3, 5, 7}.c dependency problems on older kernels

In reply to [email protected]

Hi Xu,

Quoted 18 lines

Hi Petr

Quoted 4 lines

Hi Xu,

actually quotactl0{2,3,5,7}.c and quotactl03.c fail on only on v4.5:

Quoted 8 lines

tst_kconfig.c:82: TINFO: Parsing kernel config '/.config' tst_device.c:88: TINFO: Found free device 0 '/dev/loop0' tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''

[  271.093416] XFS (loop0): Superblock has unknown read-only compatible features (0x4) enabled.
[  271.096902] XFS (loop0): Attempted to mount read-only compatible filesystem read-write.
[  271.100128] XFS (loop0): Filesystem can only be safely mounted read only.
[  271.101852] XFS (loop0): SB validate failed with error -22.

tst_test.c:1010: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d6a0) failed: EINVAL (22)

That is because you use a newer xfsprogs (it provides newer mkfs.xfs and enable reflink feature by default[1]). But older kernel can't regcozine this feature bits[2](it supports reflink feature bits since kernel 4.9-rc1), then mount failed.

Quoted 6 lines

[1]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=ec1b42e6d58dcb7cfc5de6fc825832944997e176 [2]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=f0ec1b8ef11df0a51954df7e3ff3ca4aadb0d34b

I don't think this is a problem, user should know its kernel version and xfsprogs vesion. Linux distribution has sloved this well except you used yourself compiled kernel.

TL;DR: Understand and we can stop debugging to not waste time.

Giving userspace tool needs to match kernel brings extra barrier when bisecting in the history :). I suppose there is no list to match these (actually it'd be better to ask on linux-xfs). I'd have to experiment with slightly older ones - I'm using mkfs.xfs 5.14.2 from openSUSE Tumbleweed (i.e. latest stable).

Quoted 25 lines
Quoted 13 lines

Tested on config:
grep -e QUOTA -e QFMT /.config
CONFIG_XFS_QUOTA=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y

Quoted 4 lines

But not work either on v4.10:

[  299.235456] XFS (loop0): EXPERIMENTAL reflink feature enabled. Use at your own risk!
[  299.239463] XFS (loop0): Mounting V5 Filesystem
[  299.240950] XFS (loop0): Log size 1368 blocks too small, minimum size is 1580 blocks

In xfstests, we use -lsize parameter[3] or use a value then get the correct value from error log[4]. reflink feature will increase log size[5], so we can disable reflink feature by using mkfs.xfs -m reflink=0 /dev/loop0 (it also need mkfs.xfs support, so we may need a mkfs.xfs cmd version check[5], if meet this version, use mkfs.xfs -m reflink=0, if less than this version, we can ignore this version and don't use mkfs.xfs extra option).

Quoted 2 lines

Firstly, can you try mkfs.xfs -m reflink=0 way whether fix these two problems?

Yes, adding .dev_fs_opts:

@@ -84,6 +88,12 @@ static struct tst_test test = {
        .test_all = verify_quota,
        .format_device = 1,
        .dev_fs_type = "xfs",
+       .dev_fs_opts = (const char *const[]){
+               "-m",
+               "reflink=0",
+               NULL,

+ },
+

... helps to quotactl0{2,3,5,7}.c helps to all:

quotactl0{2,3,5}.c TPASS/TCONF:
tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=0' extra opts=''

[   55.193262] XFS (loop0): Mounting V5 Filesystem
[   55.197574] XFS (loop0): Ending clean mount
[   55.199560] XFS (loop0): Quotacheck needed: Please wait.
[   55.202735] XFS (loop0): Quotacheck: Done.

tst_test.c:1456: TINFO: Timeout per run is 0h 05m 00s
quotactl_syscall_var.h:27: TINFO: Test quotactl()
quotactl02.c:119: TINFO: Test #0: QCMD(Q_XGETQSTAT, USRQUOTA) off
quotactl02.h:64: TPASS: quotactl() succeeded to turn off xfs quota and get xfs quota off status for user
...
../../../../include/lapi/quotactl.h:18: TCONF: syscall(443) __NR_quotactl_fd not supported on your arch

quotactl07.c fails on Q_XQUOTARM, but that's correct (missing 3dd4d40b4208 from v5.5)

tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=0' extra opts=''
...
quotactl07.c:37: TPASS: do_quotactl(Q_XQUOTARM,valid_type) passed quotactl07.c:41: TPASS: Q_XQUOTARM to free space, delta(1) quotactl07.c:45: TFAIL: do_quotactl(Q_XQUOTARM, invalid_type) succeeded

[  116.407282] XFS (loop0): Unmounting Filesystem

tst_test.c:1456: TINFO: Timeout per run is 0h 05m 00s
...
../../../../include/lapi/quotactl.h:18: TCONF: syscall(443) __NR_quotactl_fd not supported on your arch

=> not sure if we want to add this "-m reflink=0" to these tests (into quotactl_syscall_var.h, which they all use).

Kind regards,
Petr

Quoted 6 lines

[3]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?id=7e07c4bebb08414ca8228ea91bdf57828fd4d110 [4]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/common/xfs#n81 [5]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=a5132d9b3634fb6436d1f06642ceda82e64ea2f5

Best Regards
Yang Xu

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw

Re: [LTP] quotactl0{2, 3, 5, 7}.c dependency problems on older kernels

Hi Petr

Quoted 96 lines

Hi Xu,

Quoted 18 lines

Hi Petr

Quoted 4 lines

Hi Xu,

actually quotactl0{2,3,5,7}.c and quotactl03.c fail on only on v4.5:

Quoted 8 lines

tst_kconfig.c:82: TINFO: Parsing kernel config '/.config' tst_device.c:88: TINFO: Found free device 0 '/dev/loop0' tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''

[  271.093416] XFS (loop0): Superblock has unknown read-only compatible features (0x4) enabled.
[  271.096902] XFS (loop0): Attempted to mount read-only compatible filesystem read-write.
[  271.100128] XFS (loop0): Filesystem can only be safely mounted read only.
[  271.101852] XFS (loop0): SB validate failed with error -22.

tst_test.c:1010: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d6a0) failed: EINVAL (22)

That is because you use a newer xfsprogs (it provides newer mkfs.xfs and enable reflink feature by default[1]). But older kernel can't regcozine this feature bits[2](it supports reflink feature bits since kernel 4.9-rc1), then mount failed.

Quoted 6 lines

[1]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=ec1b42e6d58dcb7cfc5de6fc825832944997e176 [2]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=f0ec1b8ef11df0a51954df7e3ff3ca4aadb0d34b

I don't think this is a problem, user should know its kernel version and xfsprogs vesion. Linux distribution has sloved this well except you used yourself compiled kernel.

TL;DR: Understand and we can stop debugging to not waste time.

Giving userspace tool needs to match kernel brings extra barrier when bisecting in the history :). I suppose there is no list to match these (actually it'd be better to ask on linux-xfs). I'd have to experiment with slightly older ones - I'm using mkfs.xfs 5.14.2 from openSUSE Tumbleweed (i.e. latest stable).

Quoted 25 lines
Quoted 13 lines

Tested on config:
grep -e QUOTA -e QFMT /.config
CONFIG_XFS_QUOTA=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y

Quoted 4 lines

But not work either on v4.10:

[  299.235456] XFS (loop0): EXPERIMENTAL reflink feature enabled. Use at your own risk!
[  299.239463] XFS (loop0): Mounting V5 Filesystem
[  299.240950] XFS (loop0): Log size 1368 blocks too small, minimum size is 1580 blocks

In xfstests, we use -lsize parameter[3] or use a value then get the correct value from error log[4]. reflink feature will increase log size[5], so we can disable reflink feature by using mkfs.xfs -m reflink=0 /dev/loop0 (it also need mkfs.xfs support, so we may need a mkfs.xfs cmd version check[5], if meet this version, use mkfs.xfs -m reflink=0, if less than this version, we can ignore this version and don't use mkfs.xfs extra option).

Quoted 2 lines

Firstly, can you try mkfs.xfs -m reflink=0 way whether fix these two problems?

Yes, adding .dev_fs_opts:

(quoted diff) +6 -0
@@ -84,6 +88,12 @@ static struct tst_test test = {
         .test_all = verify_quota,
         .format_device = 1,
         .dev_fs_type = "xfs",
+       .dev_fs_opts = (const char *const[]){
+               "-m",
+               "reflink=0",
+               NULL,
+       },
+
 

... helps to quotactl0{2,3,5,7}.c helps to all:

quotactl0{2,3,5}.c TPASS/TCONF:
tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=0' extra opts=''

[   55.193262] XFS (loop0): Mounting V5 Filesystem
[   55.197574] XFS (loop0): Ending clean mount
[   55.199560] XFS (loop0): Quotacheck needed: Please wait.
[   55.202735] XFS (loop0): Quotacheck: Done.

tst_test.c:1456: TINFO: Timeout per run is 0h 05m 00s
quotactl_syscall_var.h:27: TINFO: Test quotactl()
quotactl02.c:119: TINFO: Test #0: QCMD(Q_XGETQSTAT, USRQUOTA) off
quotactl02.h:64: TPASS: quotactl() succeeded to turn off xfs quota and get xfs quota off status for user
...
../../../../include/lapi/quotactl.h:18: TCONF: syscall(443) __NR_quotactl_fd not supported on your arch

quotactl07.c fails on Q_XQUOTARM, but that's correct (missing 3dd4d40b4208 from v5.5)

tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=0' extra opts=''
...
quotactl07.c:37: TPASS: do_quotactl(Q_XQUOTARM,valid_type) passed quotactl07.c:41: TPASS: Q_XQUOTARM to free space, delta(1) quotactl07.c:45: TFAIL: do_quotactl(Q_XQUOTARM, invalid_type) succeeded

Quoted 7 lines
[  116.407282] XFS (loop0): Unmounting Filesystem

tst_test.c:1456: TINFO: Timeout per run is 0h 05m 00s
...
../../../../include/lapi/quotactl.h:18: TCONF: syscall(443) __NR_quotactl_fd not supported on your arch

=> not sure if we want to add this "-m reflink=0" to these tests (into quotactl_syscall_var.h, which they all use).

xfsprogs supports -m reflink after 2016.10, some old distributions xfsprogs doesn't support it ie centos7.9ga.

So if we add this, it will TCONF on these old linux distributions.

I think we need a mkfs.xfs wrapper in quotactl_syscall_var.h, this wrapper does the following thing:
1. mkfs.xfs -m reflink=0 succeed then return
2. mkfs.xfs -m reflink=0 failed then use mkfs.xfs to format, then return

ps:Another way is using MKFS_OPTIONS environment like xfstests, then we can refer to filesytem type to get value ie xfs MKFS_OPTIONS gets from XFS_MKFS_OPTIONS[1]. so the style of a complete mkfs option in case is that XFS_MKFS_OPTIONS + dev_fs_opts. But the former way is simple and enough to fix.

[1]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/common/config#n420

Best Regards
Yang Xu

Quoted 10 lines

Kind regards,
Petr

Quoted 6 lines

[3]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?id=7e07c4bebb08414ca8228ea91bdf57828fd4d110 [4]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/common/xfs#n81 [5]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=a5132d9b3634fb6436d1f06642ceda82e64ea2f5

Best Regards
Yang Xu

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#6 lore raw

Re: [LTP] quotactl0{2, 3, 5, 7}.c dependency problems on older kernels

Hi Xu,

Quoted 102 lines

Hi Petr

Quoted 100 lines

Hi Xu,

Quoted 18 lines

Hi Petr

Quoted 4 lines

Hi Xu,

actually quotactl0{2,3,5,7}.c and quotactl03.c fail on only on v4.5:

Quoted 8 lines

tst_kconfig.c:82: TINFO: Parsing kernel config '/.config' tst_device.c:88: TINFO: Found free device 0 '/dev/loop0' tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''

[  271.093416] XFS (loop0): Superblock has unknown read-only compatible features (0x4) enabled.
[  271.096902] XFS (loop0): Attempted to mount read-only compatible filesystem read-write.
[  271.100128] XFS (loop0): Filesystem can only be safely mounted read only.
[  271.101852] XFS (loop0): SB validate failed with error -22.

tst_test.c:1010: TBROK: mount(/dev/loop0, mntpoint, xfs, 0, 0x41d6a0) failed: EINVAL (22)

That is because you use a newer xfsprogs (it provides newer mkfs.xfs and enable reflink feature by default[1]). But older kernel can't regcozine this feature bits[2](it supports reflink feature bits since kernel 4.9-rc1), then mount failed.

Quoted 6 lines

[1]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=ec1b42e6d58dcb7cfc5de6fc825832944997e176 [2]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=f0ec1b8ef11df0a51954df7e3ff3ca4aadb0d34b

I don't think this is a problem, user should know its kernel version and xfsprogs vesion. Linux distribution has sloved this well except you used yourself compiled kernel.

TL;DR: Understand and we can stop debugging to not waste time.

Giving userspace tool needs to match kernel brings extra barrier when bisecting in the history :). I suppose there is no list to match these (actually it'd be better to ask on linux-xfs). I'd have to experiment with slightly older ones - I'm using mkfs.xfs 5.14.2 from openSUSE Tumbleweed (i.e. latest stable).

Quoted 25 lines
Quoted 13 lines

Tested on config:
grep -e QUOTA -e QFMT /.config
CONFIG_XFS_QUOTA=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
CONFIG_QUOTA_TREE=y
# CONFIG_QFMT_V1 is not set
CONFIG_QFMT_V2=y
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y

Quoted 4 lines

But not work either on v4.10:

[  299.235456] XFS (loop0): EXPERIMENTAL reflink feature enabled. Use at your own risk!
[  299.239463] XFS (loop0): Mounting V5 Filesystem
[  299.240950] XFS (loop0): Log size 1368 blocks too small, minimum size is 1580 blocks

In xfstests, we use -lsize parameter[3] or use a value then get the correct value from error log[4]. reflink feature will increase log size[5], so we can disable reflink feature by using mkfs.xfs -m reflink=0 /dev/loop0 (it also need mkfs.xfs support, so we may need a mkfs.xfs cmd version check[5], if meet this version, use mkfs.xfs -m reflink=0, if less than this version, we can ignore this version and don't use mkfs.xfs extra option).

Quoted 2 lines

Firstly, can you try mkfs.xfs -m reflink=0 way whether fix these two problems?

Yes, adding .dev_fs_opts:

(quoted diff) +6 -0
@@ -84,6 +88,12 @@ static struct tst_test test = {
         .test_all = verify_quota,
         .format_device = 1,
         .dev_fs_type = "xfs",
+       .dev_fs_opts = (const char *const[]){
+               "-m",
+               "reflink=0",
+               NULL,
+       },
+
 

... helps to quotactl0{2,3,5,7}.c helps to all:

quotactl0{2,3,5}.c TPASS/TCONF:
tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=0' extra opts=''

[   55.193262] XFS (loop0): Mounting V5 Filesystem
[   55.197574] XFS (loop0): Ending clean mount
[   55.199560] XFS (loop0): Quotacheck needed: Please wait.
[   55.202735] XFS (loop0): Quotacheck: Done.

tst_test.c:1456: TINFO: Timeout per run is 0h 05m 00s
quotactl_syscall_var.h:27: TINFO: Test quotactl()
quotactl02.c:119: TINFO: Test #0: QCMD(Q_XGETQSTAT, USRQUOTA) off
quotactl02.h:64: TPASS: quotactl() succeeded to turn off xfs quota and get xfs quota off status for user
...
../../../../include/lapi/quotactl.h:18: TCONF: syscall(443) __NR_quotactl_fd not supported on your arch

quotactl07.c fails on Q_XQUOTARM, but that's correct (missing 3dd4d40b4208 from v5.5)

tst_test.c:996: TINFO: Formatting /dev/loop0 with xfs opts='-m reflink=0' extra opts=''
...
quotactl07.c:37: TPASS: do_quotactl(Q_XQUOTARM,valid_type) passed quotactl07.c:41: TPASS: Q_XQUOTARM to free space, delta(1) quotactl07.c:45: TFAIL: do_quotactl(Q_XQUOTARM, invalid_type) succeeded

[  116.407282] XFS (loop0): Unmounting Filesystem

tst_test.c:1456: TINFO: Timeout per run is 0h 05m 00s
...
../../../../include/lapi/quotactl.h:18: TCONF: syscall(443) __NR_quotactl_fd not supported on your arch

Quoted 4 lines
Quoted 2 lines

=> not sure if we want to add this "-m reflink=0" to these tests (into quotactl_syscall_var.h, which they all use).

xfsprogs supports -m reflink after 2016.10, some old distributions xfsprogs doesn't support it ie centos7.9ga.

Yep sure, I realized that myself that we'd have to check xfstests version.

Quoted 6 lines

So if we add this, it will TCONF on these old linux distributions.

I think we need a mkfs.xfs wrapper in quotactl_syscall_var.h, this wrapper does the following thing:
1. mkfs.xfs -m reflink=0 succeed then return
2. mkfs.xfs -m reflink=0 failed then use mkfs.xfs to format, then return

I'm not sure if it's worth of doing it. It'd be just good to know that bisecting is a problem without it (not sure where we could document it).

But if we decide to workaround these problems, it should be IMHO in library, unless it's a problem just for these quotactl tests (i.e. does not affect any other test running on XFS).

Quoted 5 lines

ps:Another way is using MKFS_OPTIONS environment like xfstests, then we can refer to filesytem type to get value ie xfs MKFS_OPTIONS gets from XFS_MKFS_OPTIONS[1]. so the style of a complete mkfs option in case is that XFS_MKFS_OPTIONS + dev_fs_opts. But the former way is simple and enough to fix.

IMHO The bigger problem is to be aware of this limitation. I have no problem to recompile LTP test during bisecting... Maybe even list these problems somewhere. (of course fixed code with explanation in the git commit message would be also nice source of information for the future, but again, not sure if it's worth of spending time on it).

Kind regards,
Petr

Quoted 14 lines

[1]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/common/config#n420

Best Regards
Yang Xu

Quoted 9 lines

Kind regards,
Petr

Quoted 6 lines

[3]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?id=7e07c4bebb08414ca8228ea91bdf57828fd4d110 [4]https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/tree/common/xfs#n81 [5]https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=a5132d9b3634fb6436d1f06642ceda82e64ea2f5

Best Regards
Yang Xu

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp