btrfs: test for deadlock between snapshot delete and other read-write operations
authorQu Wenruo <wqu@suse.com>
Fri, 11 Jan 2019 05:01:51 +0000 (13:01 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sat, 12 Jan 2019 07:44:04 +0000 (15:44 +0800)
commit8fc1e7c157fb76d383a5d5ff81308f771a4ba42a
treee7d0feda75b5cb6fa7f87e0570885a10c756a32b
parenta4235f29f780b15d9e87c0f2446a53b9e69c5e2d
btrfs: test for deadlock between snapshot delete and other read-write operations

Commit fb235dc06fac ("btrfs: qgroup: Move half of the qgroup
accounting time out of commit trans") could cause ABBA deadlock
between backref lookup with write lock hold (subvolume deletion) and
other read/write operations.

It's going to be fixed by "btrfs: qgroup: Don't trigger backref walk
at delayed ref insert time".

This test will generate pwrite background workload, along with
constant subvolume creation and deletion to trigger the bug.

It needs some time to generate enough files to bump the tree height
to trigger the bug.

In my test environment, with 'unsafe' cache mode for the VM, it
triggers the bug at around 70~90 seconds. So I leave the default
runtime to 120s to make sure the bug will be triggered.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/179 [new file with mode: 0755]
tests/btrfs/179.out [new file with mode: 0644]
tests/btrfs/group