@@ -240,7 +240,7 @@ _populate_xfs_qmount_option()
if [ ! -f /proc/fs/xfs/xqmstat ]; then
# No quota support
return
- elif [ "${USE_EXTERNAL}" = "yes" ] && [ ! -z "${SCRATCH_RTDEV}" ]; then
+ elif [ "${USE_EXTERNAL}" = "yes" ] && [ ! -z "${SCRATCH_RTDEV}" ] && ! _xfs_supports_rtquota; then
# Quotas not supported on rt filesystems
return
elif [ -z "${XFS_QUOTA_PROG}" ]; then
@@ -23,10 +23,10 @@ _require_quota()
if [ ! -f /proc/fs/xfs/xqmstat ]; then
_notrun "Installed kernel does not support XFS quotas"
fi
- if [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ]; then
+ if [ "$USE_EXTERNAL" = yes ] && [ -n "$TEST_RTDEV" ] && ! _xfs_supports_rtquota; then
_notrun "Quotas not supported on realtime test device"
fi
- if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ]; then
+ if [ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && ! _xfs_supports_rtquota; then
_notrun "Quotas not supported on realtime scratch device"
fi
;;
@@ -44,10 +44,10 @@ _require_xfs_quota()
{
$here/src/feature -q $TEST_DEV
[ $? -ne 0 ] && _notrun "Installed kernel does not support XFS quota"
- if [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ]; then
+ if [ "$USE_EXTERNAL" = yes ] && [ -n "$TEST_RTDEV" ] && ! _xfs_supports_rtquota; then
_notrun "Quotas not supported on realtime test device"
fi
- if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ]; then
+ if [ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && ! _xfs_supports_rtquota; then
_notrun "Quotas not supported on realtime scratch device"
fi
[ -n "$XFS_QUOTA_PROG" ] || _notrun "XFS quota user tools not installed"
@@ -153,8 +153,8 @@ _require_prjquota()
fi
$here/src/feature -P $_dev
[ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
- if [ "$USE_EXTERNAL" = yes ]; then
- if [ -n "$TEST_RTDEV" -o -n "$SCRATCH_RTDEV" ]; then
+ if [ "$FSTYP" = "xfs" ] && [ "$USE_EXTERNAL" = yes ]; then
+ if [ -n "$TEST_RTDEV" -o -n "$SCRATCH_RTDEV" ] && ! _xfs_supports_rtquota; then
_notrun "Project quotas not supported on realtime filesystem"
fi
fi
@@ -2194,3 +2194,15 @@ _scratch_find_rt_metadir_entry() {
return 1
}
+
+_xfs_supports_rtquota() {
+ test "$FSTYP" = "xfs" || return 1
+
+ local xqmfile="/proc/fs/xfs/xqm"
+
+ test -e "$xqmfile" || modprobe xfs
+ test -e "$xqmfile" || return 1
+
+ local rtquota="$(cat "$xqmfile" | awk '{print $5}')"
+ test "$rtquota" = "1"
+}