]> www.infradead.org Git - users/dwmw2/linux.git/commit
dm raid: fix stripe adding reshape deadlock
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 6 Sep 2018 16:33:39 +0000 (18:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:56:01 +0000 (08:56 +0200)
commit895fe22aa4d6f8a246938be770f52102336cd71c
tree3bf2feb3a327a73806841e3e2c4aa9b78ff27ca2
parent00063fa09bc1b3ad872ce558dd1308baf276185f
dm raid: fix stripe adding reshape deadlock

[ Upstream commit 644e2537fdc77baeeefc829524937bca64329f82 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-raid.c