]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: _check_quota_usage needs to unmount to get XFS quotacheck
authorDave Chinner <dchinner@redhat.com>
Thu, 26 Jul 2012 08:35:05 +0000 (08:35 +0000)
committerroot <root@cxfsxe4.(none)>
Wed, 22 Aug 2012 20:51:02 +0000 (15:51 -0500)
Remount won't run a quota check - it's only done during mount. Hence
all quota tests using this check function are not actually
validating XFS filesystems right now.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common.quota

index 97363063299b2f83873ac311a717ce5854ef3f6b..2fa784b83f3c950affe1c763d7934790fdc8fd03 100644 (file)
@@ -236,6 +236,11 @@ _check_quota_usage()
 {
        # Sync to get delalloc to disk
        sync
+
+       # kill caches to guarantee removal speculative delalloc
+       # XXX: really need an ioctl instead of this big hammer
+       echo 3 > /proc/sys/vm/drop_caches
+
        VFS_QUOTA=0
        case $FSTYP in
        ext2|ext3|ext4|ext4dev|reiserfs)
@@ -253,8 +258,9 @@ _check_quota_usage()
                quotacheck -u -g $SCRATCH_MNT 2>/dev/null
        else
                # use XFS method to force quotacheck
-               mount -o remount,noquota $SCRATCH_DEV
-               mount -o remount,usrquota,grpquota $SCRATCH_DEV
+               xfs_quota -x -c "off -ug" $SCRATCH_MNT
+               _scratch_unmount
+               _scratch_mount "-o usrquota,grpquota"
        fi
        repquota -u -n $SCRATCH_MNT  | grep -v "^#0" | _filter_scratch |
                sort >$tmp.user.checked