]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
generic/230: reset grace time before overcome hardlimit
authorzhangyi (F) <yi.zhang@huawei.com>
Tue, 9 Apr 2019 11:04:34 +0000 (19:04 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sat, 13 Apr 2019 02:58:18 +0000 (10:58 +0800)
Currently, we call repquota to report the latest quota information
after each test case. But repquota will invoke Q_SYNC on the ext4 file
system with old quota, which may be time consuming on the low speed or
busy scratch device. If we call repquota between the "overcome
softlimit" and the "overcome hardlimit" cases, the softlimit grace time
may be exceed after repquota return, and lead to test failure.

Now, we capture the following failure when the disk is busy:

   pwrite: Disk quota exceeded
   Touch 3+4
   Touch 5+6
  +touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded
   touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
   Touch 5
   touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded

This patch reset grace time before the "overcome hardlimit" case to
avoid this failure.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/230

index e0a876ba658478cc6d457a5014a63d8dbd5cd457..405581b3a8a4b1efe4cab9ba79c50a5e1c691159 100755 (executable)
@@ -54,6 +54,10 @@ test_enforcement()
                _filter_xfs_io_error | tee -a $seqres.full
        repquota -$type $SCRATCH_MNT  | grep -v "^root" >>$seqres.full 2>&1
        # Now try to overcome block hardlimit
+       # Reset grace time here due to the repquota will invoke Q_SYNC on
+       # old quota which may be time consuming on the low speed or busy
+       # scratch device that may leed to grace time exceed.
+       setquota -$type $qa_user -T $grace $grace $SCRATCH_MNT 2>/dev/null
        echo "Write 250 blocks..."
        su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 $((250 * $BLOCK_SIZE))' -c fsync \
                $SCRATCH_MNT/file2" 2>&1 >>$seqres.full | \
@@ -75,6 +79,10 @@ test_enforcement()
                2>&1 >>$seqres.full | _filter_scratch | tee -a $seqres.full
        repquota -$type $SCRATCH_MNT  | grep -v "^root" >>$seqres.full 2>&1
        # Try to exceed inode hardlimit
+       # Reset grace time here due to the repquota will invoke Q_SYNC on
+       # old quota which may be time consuming on the low speed or busy
+       # scratch device that may leed to grace time exceed.
+       setquota -$type $qa_user -T $grace $grace $SCRATCH_MNT 2>/dev/null
        echo "Touch 5+6"
        su $qa_user -c "touch $SCRATCH_MNT/file5 $SCRATCH_MNT/file6" \
                2>&1 >>$seqres.full | _filter_scratch | tee -a $seqres.full