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 _begin_fstest auto quick quota
12 filter_project_quota_line()
14 grep -v "^project quota on"
17 # Import common functions.
21 # real QA test starts here
27 _scratch_mkfs >>$seqres.full 2>&1
28 _scratch_mount "-o usrquota,grpquota"
30 # xfs doesn't need these setups and quotacheck even fails on xfs, so just
31 # redirect the output to $seqres.full for debug purpose and ignore the results,
32 # as we check the quota status later anyway.
33 quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1
34 quotaon $SCRATCH_MNT >>$seqres.full 2>&1
36 # first remount ro with a bad option, a failed remount ro should not disable
37 # quota, but currently xfs doesn't fail in this case, the unknown option is
38 # just ignored, but quota is still on. This may change in future, let's
39 # re-consider the case then.
40 _try_scratch_mount "-o remount,ro,nosuchopt" >>$seqres.full 2>&1
41 quotaon -p $SCRATCH_MNT | _filter_scratch | filter_project_quota_line
42 # second remount should succeed, no oops or hang expected
43 _try_scratch_mount "-o remount,ro" || _fail "second remount,ro failed"