From: Shaohua Li Date: Thu, 25 Feb 2016 01:41:01 +0000 (-0800) Subject: MD: warn for potential deadlock X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=70d9798b95562abac005d4ba71d28820f9a201eb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git MD: warn for potential deadlock The personality thread shouldn't call mddev_suspend(). Because mddev_suspend() will for all IO finish, but IO is handled in personality thread, so this could cause deadlock. To trigger this early, add a warning if mddev_suspend() is called from personality thread. Suggested-by: NeilBrown Cc: Artur Paszkiewicz Signed-off-by: Shaohua Li --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 464627b7e820..c068f171b4eb 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -305,6 +305,7 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio) */ void mddev_suspend(struct mddev *mddev) { + WARN_ON_ONCE(current == mddev->thread->tsk); if (mddev->suspended++) return; synchronize_rcu();