[PATCH RFC] fstests: test for CONFIG_QFMT_V2 in _require_quota

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



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.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

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 ;)

diff --git a/common/quota b/common/quota
index 3bf7d552..237fc115 100644
--- a/common/quota
+++ b/common/quota
@@ -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)
 	;;
diff --git a/tests/ext4/053 b/tests/ext4/053
index 4f20d217..45747317 100755
--- a/tests/ext4/053
+++ b/tests/ext4/053
@@ -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() {





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux