2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
7 # Test quota handling on remount ro failure
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
24 filter_project_quota_line()
26 grep -v "^project quota on"
29 # get standard environment, filters and checks
34 # real QA test starts here
43 _scratch_mkfs >>$seqres.full 2>&1
44 _scratch_mount "-o usrquota,grpquota"
46 # xfs doesn't need these setups and quotacheck even fails on xfs, so just
47 # redirect the output to $seqres.full for debug purpose and ignore the results,
48 # as we check the quota status later anyway.
49 quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1
50 quotaon $SCRATCH_MNT >>$seqres.full 2>&1
52 # first remount ro with a bad option, a failed remount ro should not disable
53 # quota, but currently xfs doesn't fail in this case, the unknown option is
54 # just ignored, but quota is still on. This may change in future, let's
55 # re-consider the case then.
56 _try_scratch_mount "-o remount,ro,nosuchopt" >>$seqres.full 2>&1
57 quotaon -p $SCRATCH_MNT | _filter_scratch | filter_project_quota_line
58 # second remount should succeed, no oops or hang expected
59 _try_scratch_mount "-o remount,ro" || _fail "second remount,ro failed"