summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2016-02-25 02:41:01 +0100
committerShaohua Li <shli@fb.com>2016-02-26 18:44:57 +0100
commit70d9798b95562abac005d4ba71d28820f9a201eb (patch)
tree4ab92bc060a79faa8363f29462cea00cbbddcf36 /drivers/md/md.c
parentmd: Drop sending a change uevent when stopping (diff)
downloadlinux-70d9798b95562abac005d4ba71d28820f9a201eb.tar.xz
linux-70d9798b95562abac005d4ba71d28820f9a201eb.zip
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 <neilb@suse.com> Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c1
1 files changed, 1 insertions, 0 deletions
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();