MD: warn for potential deadlock
authorShaohua Li <shli@fb.com>
Thu, 25 Feb 2016 01:41:01 +0000 (17:41 -0800)
committerShaohua Li <shli@fb.com>
Fri, 26 Feb 2016 17:44:57 +0000 (09:44 -0800)
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>
drivers/md/md.c

index 464627b7e8205bf4668534651fa2954c28961848..c068f171b4eb1140ed7956d8f73f6096c14961a1 100644 (file)
@@ -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();
This page took 0.027722 seconds and 5 git commands to generate.