dm raid: fix stripe adding reshape deadlock
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 6 Sep 2018 16:33:39 +0000 (18:33 +0200)
committerMike Snitzer <snitzer@redhat.com>
Thu, 6 Sep 2018 21:07:50 +0000 (17:07 -0400)
commit644e2537fdc77baeeefc829524937bca64329f82
tree9e30a66eda423b43f61c2e4816e030ab8ae6111c
parent38b0bd0cda07d34ad6f145fce675ead74739c44e
dm raid: fix stripe adding reshape deadlock

When initiating a stripe adding reshape, a deadlock between
md_stop_writes() waiting for the sync thread to stop and the running
sync thread waiting for inactive stripes occurs (this frequently happens
on single-core but rarely on multi-core systems).

Fix this deadlock by setting MD_RECOVERY_WAIT to have the main MD
resynchronization thread worker (md_do_sync()) bail out when initiating
the reshape via constructor arguments.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-raid.c