]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/537: disable quota mount options for pre-metadir rt filesystems
authorDarrick J. Wong <djwong@kernel.org>
Fri, 21 Mar 2025 21:27:54 +0000 (14:27 -0700)
committerZorro Lang <zlang@kernel.org>
Fri, 28 Mar 2025 01:05:05 +0000 (09:05 +0800)
Fix this regression in generic/537:

mount: /opt: permission denied.
       dmesg(1) may have more information after failed mount system call.
mount -o uquota,gquota,pquota, -o ro,norecovery -ortdev=/dev/sdb4 /dev/sda4 /opt failed
mount -o uquota,gquota,pquota, -o ro,norecovery -ortdev=/dev/sdb4 /dev/sda4 /opt failed
(see /var/tmp/fstests/generic/537.full for details)

for reasons explained in the giant comment.  TLDR: quota and rt aren't
compatible on older xfs filesystems so we have to work around that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/537

index f57bc1561dd57e9b1932b59b6c1ec22787239081..3be743c4133f4ff2c3d453ef66a8dd67bd7db5ca 100755 (executable)
@@ -18,6 +18,7 @@ _begin_fstest auto quick trim
 
 # Import common functions.
 . ./common/filter
+. ./common/quota
 
 _require_scratch
 _require_fstrim
@@ -36,6 +37,22 @@ _scratch_mount -o ro >> $seqres.full 2>&1
 $FSTRIM_PROG -v $SCRATCH_MNT >> $seqres.full 2>&1
 _scratch_unmount
 
+# As of kernel commit 9f0902091c332b ("xfs: Do not allow norecovery mount with
+# quotacheck"), it is no longer possible to mount with "norecovery" and any
+# quota mount option if the quota mount options would require a metadata update
+# such as quotacheck.  For a pre-metadir XFS filesystem with a realtime volume
+# and quota-enabling options, the first two mount attempts will have succeeded
+# but with quotas disabled.  The mount option parsing for this next mount
+# attempt will see the same quota-enabling options and a lack of qflags in the
+# ondisk metadata and reject the mount because it thinks that will require
+# quotacheck.  Edit out the quota mount options for this specific
+# configuration.
+if [ "$FSTYP" = "xfs" ]; then
+       if [ "$USE_EXTERNAL" = "yes" ] && [ -n "$SCRATCH_RTDEV" ]; then
+               _qmount_option ""
+       fi
+fi
+
 echo "fstrim on ro mount with no log replay"
 norecovery="norecovery"
 test $FSTYP = "btrfs" && norecovery=nologreplay