Skip to content

Commit

Permalink
md: don't unregister the thread in mddev_suspend
Browse files Browse the repository at this point in the history
This is
 - unnecessary because mddev_suspend is always followed by a call to
   ->stop, and each ->stop unregisters the thread, and
 - a problem as it makes it awkwards to suspend and then resume a
   device as we will want later.

Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
neilbrown committed May 18, 2010
1 parent fafd7fb commit 9e35b99
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,20 +254,19 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
return rv;
}

/* mddev_suspend makes sure no new requests are submitted
* to the device, and that any requests that have been submitted
* are completely handled.
* Once ->stop is called and completes, the module will be completely
* unused.
*/
static void mddev_suspend(mddev_t *mddev)
{
BUG_ON(mddev->suspended);
mddev->suspended = 1;
synchronize_rcu();
wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0);
mddev->pers->quiesce(mddev, 1);
md_unregister_thread(mddev->thread);
mddev->thread = NULL;
/* we now know that no code is executing in the personality module,
* except possibly the tail end of a ->bi_end_io function, but that
* is certain to complete before the module has a chance to get
* unloaded
*/
}

static void mddev_resume(mddev_t *mddev)
Expand Down

0 comments on commit 9e35b99

Please sign in to comment.