fstests: test for CONFIG_QFMT_V2 in _require_quota
RFC PATCH 1/1 fstests: test for CONFIG_QFMT_V2 in _require_quota
When CONFIG_QUOTA is enabled but CONFIG_QFMT_V2 is disabled in the kernel config, many quota tests on ext4 will fail in odd ways, when in fact they should be _notrun. Add a CONFIG_QFMT_V2 test to _require_quota() to catch this for filesystems that require it.
---
Backstory:
I was handed a bunch of ext4 xfstests failures on a system which had (accidentally?) been built with CONFIG_QUOTA enabled, but with CONFIG_QFMT_V2 disabled. This led to lots of tests failing when in fact they should have _notrun due to lack of sufficient quota support, and the reason for the failure was not obvious.
I'm going to just admit that I get lost in the maze of
quota kernel configs, mount options, and on-disk features:CONFIG_QFMT_V1, CONFIG_QFMT_V2, vfsold, vfsv1, vfsv2, usrjquota, tune2fs -O quota, etc. I think that requiring CONFIG_QFMT_V2 might be a little bit heavy-handed here, but perhaps in the name of simplicity this change is reasonable, and I cc'd Jan in case he sees a better or more fine-grained approach, or if there are certain quota tests which should not require CONFIG_QFMT_V2, or if we should check for CONFIG_QFMT_V1 as well...
(Even on my old RHEL7 hosts, CONFIG_QFMT_V1 is disabled, so I don't think it's worth a separate check.)
There are a couple tests which oddly enough still succeed even with this kernel feature off - generic/234 for example. It does quotacheck and quotaon - the latter of which fails, but is ignored, then a bunch of setquota calls which succeed. I'm not sure what to make of that, I guess userspace can happily write to the quotafile without the kernel needing to understand it, but the kernel cannot do the accounting ...
generic/280 is similar.
So this change would _notrun those tests even though they only exercise setquota, and do not require kernel functionality. I'm not sure it's worth carving out special cases for them, though.
Thanks for listening ;)
common/quota +4 -1
@@ -5,7 +5,9 @@ # Functions useful for quota tests # checks that the generic quota support in the kernel is enabled -# and that we have valid quota user tools installed. +# and that we have valid quota user tools installed, as well as +# support for the modern on-disk quota format kernel config +# for filesystems that require it. # _require_quota() {
@@ -16,6 +18,7 @@ _require_quota() if [ ! -d /proc/sys/fs/quota ]; then _notrun "Installed kernel does not support quotas" fi + _require_kernel_config CONFIG_QFMT_V2 ;; gfs2|ocfs2|bcachefs) ;;
tests/ext4/053 +0 -1
@@ -46,7 +46,6 @@ _require_loop _require_command "$TUNE2FS_PROG" tune2fs MKE2FS_PROG=$(type -P mke2fs) _require_command "$MKE2FS_PROG" mke2fs -_require_kernel_config CONFIG_QFMT_V2 LOG="" print_log() {
Quoted 6 lines · Eric Sandeen
When
CONFIG_QUOTAis enabled butCONFIG_QFMT_V2is disabled in the kernel config, many quota tests on ext4 will fail in odd ways, when in fact they should be_notrun. Add aCONFIG_QFMT_V2test to_require_quota()to catch this for filesystems that require it.Signed-off-by Eric Sandeen <[email protected]>
Yeah, makes sense. Feel free to add:
Honza
Quoted 74 lines
---
Backstory:
I was handed a bunch of ext4 xfstests failures on a system which had (accidentally?) been built with
CONFIG_QUOTAenabled, but withCONFIG_QFMT_V2disabled. This led to lots of tests failing when in fact they should have_notrundue to lack of sufficient quota support, and the reason for the failure was not obvious.I'm going to just admit that I get lost in the maze of
quota kernel configs, mount options, and on-disk features:CONFIG_QFMT_V1,CONFIG_QFMT_V2, vfsold, vfsv1, vfsv2, usrjquota, tune2fs -O quota, etc. I think that requiringCONFIG_QFMT_V2might be a little bit heavy-handed here, but perhaps in the name of simplicity this change is reasonable, and I cc'd Jan in case he sees a better or more fine-grained approach, or if there are certain quota tests which should not requireCONFIG_QFMT_V2, or if we should check forCONFIG_QFMT_V1as well...(Even on my old RHEL7 hosts,
CONFIG_QFMT_V1is disabled, so I don't think it's worth a separate check.)There are a couple tests which oddly enough still succeed even with this kernel feature off - generic/234 for example. It does quotacheck and quotaon - the latter of which fails, but is ignored, then a bunch of setquota calls which succeed. I'm not sure what to make of that, I guess userspace can happily write to the quotafile without the kernel needing to understand it, but the kernel cannot do the accounting ...
generic/280 is similar.
So this change would
_notrunthose tests even though they only exercise setquota, and do not require kernel functionality. I'm not sure it's worth carving out special cases for them, though.Thanks for listening ;)
common/quota +4
-1@@ -5,7 +5,9 @@ # Functions useful for quota tests # checks that the generic quota support in the kernel is enabled -# and that we have valid quota user tools installed. +# and that we have valid quota user tools installed, as well as +# support for the modern on-disk quota format kernel config +# for filesystems that require it. # _require_quota() {@@ -16,6 +18,7 @@ _require_quota() if [ ! -d /proc/sys/fs/quota ]; then _notrun "Installed kernel does not support quotas" fi + _require_kernel_config CONFIG_QFMT_V2 ;; gfs2|ocfs2|bcachefs) ;;tests/ext4/053 +0
-1@@ -46,7 +46,6 @@ _require_loop _require_command "$TUNE2FS_PROG" tune2fs MKE2FS_PROG=$(type -P mke2fs) _require_command "$MKE2FS_PROG" mke2fs -_require_kernel_config CONFIG_QFMT_V2 LOG="" print_log() {
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR