diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2009-12-28 10:58:38 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2009-12-29 11:36:40 -0500 |
commit | 0a6dbf2bc4ea3781c530f895e2d92fd3c4a735a2 (patch) | |
tree | 0918d5f492e456f20dfb668a3d885cabc1257920 /drivers/block | |
parent | 0798219f6154baa6a8efe767bfffb4a724e4b1e1 (diff) |
drbd: Fix for a race between IO and a detach operation [Bugz 262]
In D_DISKLESS we do not hand out any new references to ldev (local_cnt)
therefore waiting until all previously handed out refereces got returned
is sufficient before actually freeing mdev->ldev.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 9348f33f6242..e898ad9eb1c3 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -1298,6 +1298,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, | |||
1298 | dev_err(DEV, "Sending state in drbd_io_error() failed\n"); | 1298 | dev_err(DEV, "Sending state in drbd_io_error() failed\n"); |
1299 | } | 1299 | } |
1300 | 1300 | ||
1301 | wait_event(mdev->misc_wait, !atomic_read(&mdev->local_cnt)); | ||
1301 | lc_destroy(mdev->resync); | 1302 | lc_destroy(mdev->resync); |
1302 | mdev->resync = NULL; | 1303 | mdev->resync = NULL; |
1303 | lc_destroy(mdev->act_log); | 1304 | lc_destroy(mdev->act_log); |