mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 03:33:59 +08:00
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>
This commit is contained in:
parent
399146b80e
commit
70d9798b95
@ -305,6 +305,7 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
|
|||||||
*/
|
*/
|
||||||
void mddev_suspend(struct mddev *mddev)
|
void mddev_suspend(struct mddev *mddev)
|
||||||
{
|
{
|
||||||
|
WARN_ON_ONCE(current == mddev->thread->tsk);
|
||||||
if (mddev->suspended++)
|
if (mddev->suspended++)
|
||||||
return;
|
return;
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
|
Loading…
Reference in New Issue
Block a user