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
42 _scratch_mkfs >>$seqres.full 2>&1
43 _scratch_mount "-o usrquota,grpquota"
45 # xfs doesn't need these setups and quotacheck even fails on xfs, so just
46 # redirect the output to $seqres.full for debug purpose and ignore the results,
47 # as we check the quota status later anyway.
48 quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1
49 quotaon $SCRATCH_MNT >>$seqres.full 2>&1
51 # first remount ro with a bad option, a failed remount ro should not disable
52 # quota, but currently xfs doesn't fail in this case, the unknown option is
53 # just ignored, but quota is still on. This may change in future, let's
54 # re-consider the case then.
55 _try_scratch_mount "-o remount,ro,nosuchopt" >>$seqres.full 2>&1
56 quotaon -p $SCRATCH_MNT | _filter_scratch | filter_project_quota_line
57 # second remount should succeed, no oops or hang expected
58 _try_scratch_mount "-o remount,ro" || _fail "second remount,ro failed"