@@ -33,9 +33,25 @@ features=""
if ! _has_metadata_journaling $SCRATCH_DEV >/dev/null; then
features="nojournal"
elif [ "$FSTYP" = "xfs" ] && echo "$MOUNT_OPTIONS" | grep -q quota ; then
- # Mounting with quota on XFS requires a writable fs, which means
- # we expect to fail the ro blockdev test with with EPERM.
+ # *Trying* to mount with quota on XFS requires a writable fs, which
+ # means we expect to fail the ro blockdev test with with EPERM. It
+ # doesn't matter if xfs_mount would ultimately decide that quota is not
+ # supported.
features="xfsquota"
+
+ if _xfs_has_feature $SCRATCH_DEV parent && \
+ ! _xfs_has_feature $SCRATCH_DEV realtime; then
+ # If we have quotas and parent pointers enabled, the primary
+ # superblock will be written out with the quota flags set when
+ # the logged xattrs log_incompat feature is set. Hence the
+ # ro-norecovery mount won't fail with EPERM because the ondisk
+ # super's qflags actually match the mount qflags.
+ #
+ # Quota is not supported with realtime; in that case, the
+ # ondisk super's qflags will be zero and hence not match the
+ # mount qflags. Select 'xfsquota' in that case.
+ features="xfsquotaparent"
+ fi
fi
_link_out_file "$features"
@@ -1,2 +1,3 @@
nojournal: nojournal
xfsquota: xfsquota
+xfsquotaparent: xfsquotaparent
new file mode 100644
@@ -0,0 +1,23 @@
+QA output created by 050
+setting device read-only
+mounting read-only block device:
+mount: SCRATCH_MNT: permission denied
+unmounting read-only filesystem
+umount: SCRATCH_DEV: not mounted
+setting device read-write
+mounting read-write block device:
+touch files
+going down:
+unmounting shutdown filesystem:
+setting device read-only
+mounting filesystem that needs recovery on a read-only device:
+mount: device write-protected, mounting read-only
+mount: cannot mount device read-only
+unmounting read-only filesystem
+umount: SCRATCH_DEV: not mounted
+mounting filesystem with -o norecovery on a read-only device:
+mount: device write-protected, mounting read-only
+unmounting read-only filesystem
+setting device read-write
+mounting filesystem that needs recovery with -o ro:
+*** done