From: Darrick J. Wong Date: Wed, 24 Jul 2019 15:55:43 +0000 (-0700) Subject: generic/506: mount scratch fs before testing for prjquota presence X-Git-Tag: v2022.05.01~1079 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d67b78bd9eef5484ce58459713a6294af0f53d0b;p=users%2Fhch%2Fxfstests-dev.git generic/506: mount scratch fs before testing for prjquota presence On XFS, the _require_prjquota helper takes a path to a block device, but (unintuitively) requires the block device to be mounted for the detection to work properly. Fix the detection code in generic/506. Signed-off-by: Darrick J. Wong Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/quota b/common/quota index 3f46eb194..659c62195 100644 --- a/common/quota +++ b/common/quota @@ -68,7 +68,8 @@ _require_xfs_quota_foreign() } # -# checks that the project quota support in the kernel is enabled. +# Checks that the project quota support in the kernel is enabled. +# The device must be mounted for detection to work properly. # _require_prjquota() { diff --git a/tests/generic/506 b/tests/generic/506 index 7002c00cc..e8d0ca241 100755 --- a/tests/generic/506 +++ b/tests/generic/506 @@ -51,7 +51,9 @@ _require_scratch_shutdown _scratch_mkfs >/dev/null 2>&1 _require_metadata_journaling $SCRATCH_DEV +_scratch_mount _require_prjquota $SCRATCH_DEV +_scratch_unmount testfile=$SCRATCH_MNT/testfile