diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-03-03 02:25:33 +0100 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-03-11 16:02:45 +0100 |
commit | 4589d7f829951c1713ef5a4ad1a9bb563da329b5 (patch) | |
tree | 96a1ef3be7118a0a0dbf6b18f609486323f062c5 /drivers/block/drbd/drbd_receiver.c | |
parent | 676396d545350a70d922605ec23c2ed26124334a (diff) | |
download | op-kernel-dev-4589d7f829951c1713ef5a4ad1a9bb563da329b5.zip op-kernel-dev-4589d7f829951c1713ef5a4ad1a9bb563da329b5.tar.gz |
drbd_disconnect: grab meta.socket mutex as well
Fixes a race and potential kernel panic if e.g. the worker was just
about to send a few P_RS_IS_IN_SYNC via the meta socket for checksum
based resync, while the receiver destroys the sockets in
drbd_disconnect.
To make sure no-one is using the meta socket,
it is not enough to stop the asender...
Grab the meta socket mutex before destroying it.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 41f36a9..d803e6c 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3617,10 +3617,7 @@ static void drbd_disconnect(struct drbd_conf *mdev) /* asender does not clean up anything. it must not interfere, either */ drbd_thread_stop(&mdev->asender); - - mutex_lock(&mdev->data.mutex); drbd_free_sock(mdev); - mutex_unlock(&mdev->data.mutex); spin_lock_irq(&mdev->req_lock); _drbd_wait_ee_list_empty(mdev, &mdev->active_ee); |