--- /dev/null
+#! /bin/bash
+# FS QA Test No. 379
+#
+# Check behavior of chown with both user and group quota enabled,
+# and changing both user and group together via chown(2).
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+_cleanup()
+{
+ _scratch_unmount 2>/dev/null
+ rm -f $tmp.*
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux IRIX
+
+cp /dev/null $seqres.full
+chmod ugo+rwx $seqres.full
+
+_require_scratch
+_require_quota
+_require_xfs_quota_foreign
+
+_filter_stat()
+{
+ sed "
+ /^Access:/d;
+ /^Modify:/d;
+ /^Change:/d;
+ s/Device: *[0-9][0-9]*,[0-9][0-9]*/Device: <DEVICE>/;
+ s/Inode: *[0-9][0-9]*/Inode: <INODE>/;
+ s,$SCRATCH_MNT,<MOUNT>,;
+ " | tr -s ' '
+}
+
+_exercise()
+{
+ _scratch_mkfs >/dev/null 2>&1
+ _qmount
+
+ umask 022
+ touch $SCRATCH_MNT/testfile
+ if src/feature -c $SCRATCH_MNT/testfile; then
+ :
+ else
+ _notrun "Installed fileutils doesn't support 32 bit uids/gids"
+ fi
+
+ chown 12345 $SCRATCH_MNT/testfile
+ chgrp 54321 $SCRATCH_MNT/testfile
+ src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+
+ chown 34567 $SCRATCH_MNT/testfile
+ chgrp 76543 $SCRATCH_MNT/testfile
+ src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+
+ chown 56789 $SCRATCH_MNT/testfile
+ chgrp 98765 $SCRATCH_MNT/testfile
+ src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+
+ # finally give back to original owners
+ chown 12345 $SCRATCH_MNT/testfile
+ chgrp 54321 $SCRATCH_MNT/testfile
+ src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
+
+ echo
+ _scratch_unmount 2>/dev/null
+}
+
+_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed!"
+
+_qmount_option "usrquota,grpquota"
+_qmount
+if src/feature -G $SCRATCH_DEV ; then
+ :
+else
+ _notrun "No quota support at mount time"
+fi
+_scratch_unmount 2>/dev/null
+
+_qmount_option "rw" # no quota options
+echo "*** Default mount options"
+_exercise
+
+_qmount_option "usrquota"
+echo "*** User quota mount option"
+_exercise
+
+_qmount_option "grpquota"
+echo "*** Group quota mount option"
+_exercise
+
+_qmount_option "usrquota,grpquota"
+echo "*** User and Group quota mount options"
+_exercise
+
+# success, all done
+status=0
+exit
--- /dev/null
+QA output created by 379
+*** Default mount options
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1
+
+*** User quota mount option
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1
+
+*** Group quota mount option
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1
+
+*** User and Group quota mount options
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
+Device: <DEVICE> Inode: <INODE> Links: 1
+ File: "<MOUNT>/testfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
+Device: <DEVICE> Inode: <INODE> Links: 1
+
--- /dev/null
+#! /bin/bash
+# FS QA Test No. 380
+#
+# To test out pv#940675 crash in xfs_trans_brelse + quotas
+# Without the fix, this will create an ASSERT failure in debug kernels
+# and crash a non-debug kernel.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_supported_os IRIX Linux
+
+_require_scratch
+_require_quota
+_require_xfs_quota_foreign
+
+_chowning_file()
+{
+ file=file.chown
+ let start=$1
+ let limit=$2
+ let delta=$3
+
+ cd $SCRATCH_MNT
+ let count=$start
+ while (( count < limit )); do
+ touch $file
+ chown $count.$count $file
+ echo -n "."
+ let count=count+delta
+ done
+ echo ""
+}
+
+echo "mkfs on scratch"
+_scratch_mkfs >$seqres.full 2>&1
+
+echo "mount with quotas"
+export MOUNT_OPTIONS="-o usrquota"
+_scratch_mount
+
+echo "creating quota file with holes"
+_chowning_file 1000 2000 100
+
+echo "now fill in the holes"
+_chowning_file 1000 2000 1
+
+echo "look at the final file ownership for fun"
+ls -l $SCRATCH_MNT/* \
+| $AWK_PROG 'NF > 2 {print $3, $4, $NF}' \
+| sed "s#$SCRATCH_MNT#SCRATCH_MNT#g"
+
+# success, all done
+status=0
+exit
--- /dev/null
+QA output created by 380
+mkfs on scratch
+mount with quotas
+creating quota file with holes
+..........
+now fill in the holes
+........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
+look at the final file ownership for fun
+1999 1999 SCRATCH_MNT/file.chown
--- /dev/null
+#! /bin/bash
+# FS QA Test 138
+#
+# Test xfs_quota when user or names beginning with digits.
+# For example, create a 'limit' for a user or group named
+# '12345678-abcd', then query this user and group.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_require_xfs_quota_foreign
+
+# need user and group named 123456-fsgqa
+_require_user 123456-fsgqa
+_require_group 123456-fsgqa
+
+_scratch_mkfs >/dev/null 2>&1
+_qmount_option "usrquota,grpquota"
+_qmount
+
+# user test
+echo "== user test =="
+$XFS_QUOTA_PROG -x -c "limit -u bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
+echo "=== quota command output ==="
+$XFS_QUOTA_PROG -c "quota -u -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
+echo "=== report command output ==="
+$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
+
+# group test
+echo "== group test =="
+$XFS_QUOTA_PROG -x -c "limit -g bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
+echo "=== quota command output ==="
+$XFS_QUOTA_PROG -c "quota -g -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
+echo "=== report command output ==="
+$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
+
+# success, all done
+status=0
+exit
--- /dev/null
+QA output created by 381
+== user test ==
+=== quota command output ===
+SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
+=== report command output ===
+123456-fsgqa 0 102400 204800 00 [--------]
+
+== group test ==
+=== quota command output ===
+SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
+=== report command output ===
+123456-fsgqa 0 102400 204800 00 [--------]
+
--- /dev/null
+#! /bin/bash
+# FS QA Test 260
+#
+# When default quota is set, all different quota types inherits the
+# same default value, include group quota. So if a user quota limit
+# larger than the default user quota value, it will still be limited
+# by the group default quota value.
+#
+# There's a patch from Upstream can fix this bug:
+#
+# [PATCH] xfs: Split default quota limits by quota type V4
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+_require_xfs_quota_foreign
+_require_user
+_require_group
+
+do_test()
+{
+ local qname=$1
+ local type
+
+ if [ "$qname" = "user" ];then
+ type="-u"
+ echo "=== user quota test ==="
+ elif [ "$qname" = "group" ];then
+ type="-g"
+ echo "=== group quota test ==="
+ else
+ echo "wrong quota type name - $qname"
+ return 1
+ fi
+
+ $XFS_QUOTA_PROG -x -c "limit bsoft=20M bhard=20M isoft=20 ihard=20 $type -d" $SCRATCH_MNT
+ $XFS_QUOTA_PROG -x -c "limit bsoft=40M bhard=40M isoft=40 ihard=40 $type fsgqa" $SCRATCH_MNT
+ echo "$qname blocks and inode limit"
+ $XFS_QUOTA_PROG -x -c "report $type -N -bi" $SCRATCH_MNT | grep -v ^root | _filter_spaces
+
+ ## blocks default quota test ##
+ _user_do "$XFS_IO_PROG -f -c \"pwrite 0 30M\" -c \"fsync\" $SCRATCH_MNT/data" | _filter_xfs_io
+ echo "$qname blocks quota after write 30M data"
+ $XFS_QUOTA_PROG -x -c "report $type -N -b" $SCRATCH_MNT | grep -v ^root | _filter_spaces
+
+ rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
+
+ ## inode default quota test ##
+ for ((i=0; i<30; i++));do
+ _user_do "echo -n > ${SCRATCH_MNT}/file${i}"
+ done
+ sync
+
+ echo "$qname inode quota after creating 30 inodes"
+ $XFS_QUOTA_PROG -x -c "report $type -N -i" $SCRATCH_MNT | grep -v ^root | _filter_spaces
+
+ rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
+}
+
+### user default quota test ###
+_scratch_mkfs >/dev/null 2>&1
+_qmount_option "usrquota,grpquota"
+_qmount
+
+do_test user
+
+### group default quota test ###
+_scratch_unmount
+_scratch_mkfs >/dev/null 2>&1
+_qmount_option "grpquota,usrquota"
+_qmount
+
+do_test group
+
+# success, all done
+status=0
+exit
--- /dev/null
+QA output created by 382
+=== user quota test ===
+user blocks and inode limit
+fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
+
+wrote 31457280/31457280 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+user blocks quota after write 30M data
+fsgqa 30720 40960 40960 00 [--------]
+
+user inode quota after creating 30 inodes
+fsgqa 30 40 40 00 [--------]
+
+=== group quota test ===
+group blocks and inode limit
+fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
+
+wrote 31457280/31457280 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+group blocks quota after write 30M data
+fsgqa 30720 40960 40960 00 [--------]
+
+group inode quota after creating 30 inodes
+fsgqa 30 40 40 00 [--------]
+
376 auto quick metadata
377 attr auto quick metadata
378 auto quick metadata
+379 quota auto quick
+380 quota auto quick
+381 auto quick quota
+382 auto quick quota
+++ /dev/null
-#! /bin/bash
-# FS QA Test No. 054
-#
-# Check behavior of chown with both user and group quota enabled,
-# and changing both user and group together via chown(2).
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#-----------------------------------------------------------------------
-#
-
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-. ./common/quota
-
-_cleanup()
-{
- _scratch_unmount 2>/dev/null
- rm -f $tmp.*
-}
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-# real QA test starts here
-_supported_fs generic
-_supported_os Linux IRIX
-
-cp /dev/null $seqres.full
-chmod ugo+rwx $seqres.full
-
-_require_scratch
-_require_quota
-_require_xfs_quota_foreign
-
-_filter_stat()
-{
- sed "
- /^Access:/d;
- /^Modify:/d;
- /^Change:/d;
- s/Device: *[0-9][0-9]*,[0-9][0-9]*/Device: <DEVICE>/;
- s/Inode: *[0-9][0-9]*/Inode: <INODE>/;
- s,$SCRATCH_MNT,<MOUNT>,;
- " | tr -s ' '
-}
-
-_exercise()
-{
- _scratch_mkfs >/dev/null 2>&1
- _qmount
-
- umask 022
- touch $SCRATCH_MNT/testfile
- if src/feature -c $SCRATCH_MNT/testfile; then
- :
- else
- _notrun "Installed fileutils doesn't support 32 bit uids/gids"
- fi
-
- chown 12345 $SCRATCH_MNT/testfile
- chgrp 54321 $SCRATCH_MNT/testfile
- src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
-
- chown 34567 $SCRATCH_MNT/testfile
- chgrp 76543 $SCRATCH_MNT/testfile
- src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
-
- chown 56789 $SCRATCH_MNT/testfile
- chgrp 98765 $SCRATCH_MNT/testfile
- src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
-
- # finally give back to original owners
- chown 12345 $SCRATCH_MNT/testfile
- chgrp 54321 $SCRATCH_MNT/testfile
- src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
-
- echo
- _scratch_unmount 2>/dev/null
-}
-
-_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed!"
-
-_qmount_option "usrquota,grpquota"
-_qmount
-if src/feature -G $SCRATCH_DEV ; then
- :
-else
- _notrun "No quota support at mount time"
-fi
-_scratch_unmount 2>/dev/null
-
-_qmount_option "rw" # no quota options
-echo "*** Default mount options"
-_exercise
-
-_qmount_option "usrquota"
-echo "*** User quota mount option"
-_exercise
-
-_qmount_option "grpquota"
-echo "*** Group quota mount option"
-_exercise
-
-_qmount_option "usrquota,grpquota"
-echo "*** User and Group quota mount options"
-_exercise
-
-# success, all done
-status=0
-exit
+++ /dev/null
-QA output created by 054
-*** Default mount options
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1
-
-*** User quota mount option
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1
-
-*** Group quota mount option
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1
-
-*** User and Group quota mount options
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (34567) Gid: (76543)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (56789) Gid: (98765)
-Device: <DEVICE> Inode: <INODE> Links: 1
- File: "<MOUNT>/testfile"
- Size: 0 Filetype: Regular File
- Mode: (0644/-rw-r--r--) Uid: (12345) Gid: (54321)
-Device: <DEVICE> Inode: <INODE> Links: 1
-
+++ /dev/null
-#! /bin/bash
-# FS QA Test No. 118
-#
-# To test out pv#940675 crash in xfs_trans_brelse + quotas
-# Without the fix, this will create an ASSERT failure in debug kernels
-# and crash a non-debug kernel.
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#-----------------------------------------------------------------------
-#
-
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-. ./common/quota
-
-# real QA test starts here
-
-# Modify as appropriate.
-_supported_fs generic
-_supported_os IRIX Linux
-
-_require_scratch
-_require_quota
-_require_xfs_quota_foreign
-
-_chowning_file()
-{
- file=file.chown
- let start=$1
- let limit=$2
- let delta=$3
-
- cd $SCRATCH_MNT
- let count=$start
- while (( count < limit )); do
- touch $file
- chown $count.$count $file
- echo -n "."
- let count=count+delta
- done
- echo ""
-}
-
-echo "mkfs on scratch"
-_scratch_mkfs >$seqres.full 2>&1
-
-echo "mount with quotas"
-export MOUNT_OPTIONS="-o usrquota"
-_scratch_mount
-
-echo "creating quota file with holes"
-_chowning_file 1000 2000 100
-
-echo "now fill in the holes"
-_chowning_file 1000 2000 1
-
-echo "look at the final file ownership for fun"
-ls -l $SCRATCH_MNT/* \
-| $AWK_PROG 'NF > 2 {print $3, $4, $NF}' \
-| sed "s#$SCRATCH_MNT#SCRATCH_MNT#g"
-
-# success, all done
-status=0
-exit
+++ /dev/null
-QA output created by 118
-mkfs on scratch
-mount with quotas
-creating quota file with holes
-..........
-now fill in the holes
-........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
-look at the final file ownership for fun
-1999 1999 SCRATCH_MNT/file.chown
+++ /dev/null
-#! /bin/bash
-# FS QA Test 138
-#
-# Test xfs_quota when user or names beginning with digits.
-# For example, create a 'limit' for a user or group named
-# '12345678-abcd', then query this user and group.
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#-----------------------------------------------------------------------
-#
-
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-. ./common/quota
-
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
-# real QA test starts here
-_supported_fs generic
-_supported_os Linux
-_require_scratch
-_require_quota
-_require_xfs_quota_foreign
-
-# need user and group named 123456-fsgqa
-_require_user 123456-fsgqa
-_require_group 123456-fsgqa
-
-_scratch_mkfs >/dev/null 2>&1
-_qmount_option "usrquota,grpquota"
-_qmount
-
-# user test
-echo "== user test =="
-$XFS_QUOTA_PROG -x -c "limit -u bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
-echo "=== quota command output ==="
-$XFS_QUOTA_PROG -c "quota -u -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
-echo "=== report command output ==="
-$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
-
-# group test
-echo "== group test =="
-$XFS_QUOTA_PROG -x -c "limit -g bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
-echo "=== quota command output ==="
-$XFS_QUOTA_PROG -c "quota -g -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
-echo "=== report command output ==="
-$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
-
-# success, all done
-status=0
-exit
+++ /dev/null
-QA output created by 138
-== user test ==
-=== quota command output ===
-SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
-=== report command output ===
-123456-fsgqa 0 102400 204800 00 [--------]
-
-== group test ==
-=== quota command output ===
-SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
-=== report command output ===
-123456-fsgqa 0 102400 204800 00 [--------]
-
+++ /dev/null
-#! /bin/bash
-# FS QA Test 260
-#
-# When default quota is set, all different quota types inherits the
-# same default value, include group quota. So if a user quota limit
-# larger than the default user quota value, it will still be limited
-# by the group default quota value.
-#
-# There's a patch from Upstream can fix this bug:
-#
-# [PATCH] xfs: Split default quota limits by quota type V4
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#-----------------------------------------------------------------------
-#
-
-seq=`basename $0`
-seqres=$RESULT_DIR/$seq
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1 # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
- cd /
- rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-. ./common/quota
-
-# remove previous $seqres.full before test
-rm -f $seqres.full
-
-# real QA test starts here
-_supported_fs generic
-_supported_os Linux
-_require_scratch
-_require_quota
-_require_xfs_quota_foreign
-_require_user
-_require_group
-
-do_test()
-{
- local qname=$1
- local type
-
- if [ "$qname" = "user" ];then
- type="-u"
- echo "=== user quota test ==="
- elif [ "$qname" = "group" ];then
- type="-g"
- echo "=== group quota test ==="
- else
- echo "wrong quota type name - $qname"
- return 1
- fi
-
- $XFS_QUOTA_PROG -x -c "limit bsoft=20M bhard=20M isoft=20 ihard=20 $type -d" $SCRATCH_MNT
- $XFS_QUOTA_PROG -x -c "limit bsoft=40M bhard=40M isoft=40 ihard=40 $type fsgqa" $SCRATCH_MNT
- echo "$qname blocks and inode limit"
- $XFS_QUOTA_PROG -x -c "report $type -N -bi" $SCRATCH_MNT | grep -v ^root | _filter_spaces
-
- ## blocks default quota test ##
- _user_do "$XFS_IO_PROG -f -c \"pwrite 0 30M\" -c \"fsync\" $SCRATCH_MNT/data" | _filter_xfs_io
- echo "$qname blocks quota after write 30M data"
- $XFS_QUOTA_PROG -x -c "report $type -N -b" $SCRATCH_MNT | grep -v ^root | _filter_spaces
-
- rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
-
- ## inode default quota test ##
- for ((i=0; i<30; i++));do
- _user_do "echo -n > ${SCRATCH_MNT}/file${i}"
- done
- sync
-
- echo "$qname inode quota after creating 30 inodes"
- $XFS_QUOTA_PROG -x -c "report $type -N -i" $SCRATCH_MNT | grep -v ^root | _filter_spaces
-
- rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
-}
-
-### user default quota test ###
-_scratch_mkfs >/dev/null 2>&1
-_qmount_option "usrquota,grpquota"
-_qmount
-
-do_test user
-
-### group default quota test ###
-_scratch_unmount
-_scratch_mkfs >/dev/null 2>&1
-_qmount_option "grpquota,usrquota"
-_qmount
-
-do_test group
-
-# success, all done
-status=0
-exit
+++ /dev/null
-QA output created by 260
-=== user quota test ===
-user blocks and inode limit
-fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
-
-wrote 31457280/31457280 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-user blocks quota after write 30M data
-fsgqa 30720 40960 40960 00 [--------]
-
-user inode quota after creating 30 inodes
-fsgqa 30 40 40 00 [--------]
-
-=== group quota test ===
-group blocks and inode limit
-fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
-
-wrote 31457280/31457280 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-group blocks quota after write 30M data
-fsgqa 30720 40960 40960 00 [--------]
-
-group inode quota after creating 30 inodes
-fsgqa 30 40 40 00 [--------]
-
051 auto log metadata
052 quota db auto quick
053 attr acl repair quick auto
-054 quota auto quick
055 dump ioctl remote tape
056 dump ioctl auto quick
057 acl auto
115 parent attr
116 quota auto quick
117 fuzzers
-118 quota auto quick
119 log v2log auto freeze dangerous
120 fuzzers
121 log auto quick
135 auto logprint quick v2log
136 attr2
137 auto metadata v2log
-138 auto quick quota
139 auto quick clone
140 auto clone
141 auto log metadata
257 auto quick clone
258 auto quick clone
259 auto quick
-260 auto quick quota
261 auto quick quota
262 auto quick quota
263 auto quick quota