diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2016-05-03 13:43:57 -0400 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-05-09 12:23:23 -0400 |
commit | 092398dce8c2406bfb0c9eebc3e764ff2ddb62a8 (patch) | |
tree | acd59a4aedd6a948955d31d8cfe007c52f0fec29 /drivers/md/md.c | |
parent | bc47e84258be3e49c14be65a111f2117ecc986f6 (diff) |
md: md.c: fix oops in mddev_suspend for raid0
Introduced by upstream commit 70d9798b95562abac005d4ba71d28820f9a201eb
The raid0 personality does not create mddev->thread as oposed to
other personalities leading to its unconditional access in
mddev_suspend() causing an oops.
Patch checks for mddev->thread in order to keep the
intention of aforementioned commit.
Fixes: 70d9798b9556 ("MD: warn for potential deadlock")
Cc: stable@vger.kernel.org (4.5+)
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 06f6e81f1516..23c6d732a374 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -307,7 +307,7 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio) | |||
307 | */ | 307 | */ |
308 | void mddev_suspend(struct mddev *mddev) | 308 | void mddev_suspend(struct mddev *mddev) |
309 | { | 309 | { |
310 | WARN_ON_ONCE(current == mddev->thread->tsk); | 310 | WARN_ON_ONCE(mddev->thread && current == mddev->thread->tsk); |
311 | if (mddev->suspended++) | 311 | if (mddev->suspended++) |
312 | return; | 312 | return; |
313 | synchronize_rcu(); | 313 | synchronize_rcu(); |