Re: [PATCH 1/2] btrfs/131: test for umount of read-only fs when quota rescan is paused

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On 8/17/16 4:45 AM, Eryu Guan wrote:
> On Tue, Aug 16, 2016 at 02:30:21PM -0400, Jeff Mahoney wrote:
>> +_require_btrfs
>> +BTRFS_DEBUG_TREE_PROG="`set_prog_path btrfs-debug-tree`"
>> +_require_command "$BTRFS_DEBUG_TREE_PROG" btrfs-debug-tree
>> +TIMEOUT_PROG="`set_prog_path timeout`"
>> +_require_command "$TIMEOUT_PROG" timeout
> 
> The "set_prog_path" calls belong to common/config, we only need
> "_require_command" calls in test.

Ok, then we should probably fix up the existing cases that do this in
tests/ since this and the cp /lib/modules thing were copied from other
test cases in the repo.

>> +
>> +rm -f $seqres.full
>> +_scratch_mkfs >>$seqres.full 2>&1
>> +
>> +_scratch_mount
>> +cp -aR /lib/modules/$(uname -r) $SCRATCH_MNT
> 
> Consider populating the filesystem using _populate_fs or fsstress?

Same.

>> +
>> +# A qgroup rescan on an empty or small file system completes nearly
>> +# immediately.  We need to ensure that it runs long enough that it will
>> +# be paused on umount.  Snapshots slow down the rescan so we should see
>> +# the race without a lot of data.  This is an arbitrary number that
>> +# works on a ramdisk so it should be sufficient for any storage.
>> +for n in $(seq 1 100); do
>> +  _run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/$n
> 
> Use tab for indention.

Ok.

>> +done
>> +_run_btrfs_util_prog quota enable $SCRATCH_MNT
>> +_scratch_unmount
>> +
>> +echo "read-write umount completed"
>> +
>> +# Confirm that the rescan is paused
>> +if ! $BTRFS_DEBUG_TREE_PROG $SCRATCH_DEV | \
>> +	egrep -q 'flags ON|SCANNING|INCONSISTENT scan'; then
>> +	echo "qgroup rescan not paused."
>> +fi
>> +_scratch_mount -r
>> +
>> +# If the bug exists, this will hang.  If we can kill it, that's another bug.
>> +$TIMEOUT_PROG 10 umount $SCRATCH_MNT
>> +if test $? -eq 124 ; then
>> +    echo "umount hung but was killed"
> 
> I see this log with 4.8-rc1 kernel, is that expected?

Yes, the patch was posted this week and hasn't landed yet.

Thanks,

-Jeff

-- 
Jeff Mahoney
SUSE Labs

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux