diff options
| author | Wang Shilong <[email protected]> | 2013-12-04 13:16:53 +0000 |
|---|---|---|
| committer | Chris Mason <[email protected]> | 2014-01-28 21:19:53 +0000 |
| commit | cb7ab02156e4ba999df90e9fa8e96107683586fd (patch) | |
| tree | 3557996fdee5e02bfd5f921aa1522fa87f54687c /fs/btrfs/dev-replace.c | |
| parent | Btrfs: fix wrong super generation mismatch when scrubbing supers (diff) | |
| download | kernel-cb7ab02156e4ba999df90e9fa8e96107683586fd.tar.gz kernel-cb7ab02156e4ba999df90e9fa8e96107683586fd.zip | |
Btrfs: wrap repeated code into scrub_blocked_if_needed()
Just wrap same code into one function scrub_blocked_if_needed().
This make a change that we will move waiting (@workers_pending = 0)
before we can wake up commiting transaction(atomic_inc(@scrub_paused)),
we must take carefully to not deadlock here.
Thread 1 Thread 2
|->btrfs_commit_transaction()
|->set trans type(COMMIT_DOING)
|->btrfs_scrub_paused()(blocked)
|->join_transaction(blocked)
Move btrfs_scrub_paused() before setting trans type which means we can
still join a transaction when commiting_transaction is blocked.
Signed-off-by: Wang Shilong <[email protected]>
Suggested-by: Miao Xie <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
