_notrun "Installed kernel does not support quotas"
fi
;;
- gfs2)
+ gfs2|ocfs2)
;;
xfs)
if [ ! -f /proc/fs/xfs/xqmstat ]; then
_notrun "disk quotas not supported by this filesystem type: $FSTYP"
;;
esac
-
- # SELinux adds extra xattrs which can mess up our expected output.
- # So, mount with a context, and they won't be created
- # nfs_t is a "liberal" context so we can use it.
- if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
- export SELINUX_MOUNT_OPTIONS="-o context=system_u:object_r:nfs_t:s0"
- fi
}
#
fi
}
+#
+# Do we have GETNEXTQUOTA? Querying ID 0 should work.
+#
+_require_getnextquota()
+{
+ _require_test_program "test-nextquota"
+ $here/src/test-nextquota -i 0 -u -d $SCRATCH_DEV &> $seqres.full || \
+ _notrun "No GETNEXTQUOTA support"
+}
+
#
# ext4 (for now) is unique in that we must enable the project quota feature
# prior to mount. This is a relatively new feature ...
[ "$FSTYP" != "ext4" ] && return
tune2fs -O quota,project $SCRATCH_DEV >>$seqres.full 2>&1
+ _scratch_mount >/dev/null 2>&1 \
+ || _notrun "kernel doesn't support project feature on $FSTYP"
+ _scratch_unmount
}
#
VFS_QUOTA=1
quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
;;
+ xfs)
+ # Clear out speculative preallocations to eliminate them
+ # as a source of intermittent orig/checked differences.
+ test -x "$XFS_SPACEMAN_PROG" && \
+ "$XFS_SPACEMAN_PROG" -c 'prealloc -s' $SCRATCH_MNT
+ ;;
*)
;;
esac
}
}
+# Report the block usage of root, $qa_user, and nobody
+_report_quota_blocks() {
+ repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $3, $4, $5}'
+}
+
+# Report the inode usage of root, $qa_user, and nobody
+_report_quota_inodes() {
+ repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}'
+}
+
# make sure this script returns success
/bin/true