diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-11-10 21:19:11 +0100 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 16:58:08 +0100 |
commit | 77fede5137574813e415a4cf23038b6688ba2470 (patch) | |
tree | c870c10cae5e3434ba4f5a97c6ec17205de1a6d9 /drivers/block/drbd/drbd_receiver.c | |
parent | 1e9dd2912e3423ebf3c6ab7d824b13205310bfc9 (diff) |
drbd: Fix the WO=drain implementation for multiple volumes
Wait until IO is drained in all volumes.
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 | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 6675e2c4e4f..be8f469bc8f 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1334,6 +1334,22 @@ static void drbd_remove_epoch_entry_interval(struct drbd_conf *mdev, wake_up(&mdev->misc_wait); } +void conn_wait_active_ee_empty(struct drbd_tconn *tconn) +{ + struct drbd_conf *mdev; + int vnr; + + rcu_read_lock(); + idr_for_each_entry(&tconn->volumes, mdev, vnr) { + kref_get(&mdev->kref); + rcu_read_unlock(); + drbd_wait_ee_list_empty(mdev, &mdev->active_ee); + kref_put(&mdev->kref, &drbd_minor_destroy); + rcu_read_lock(); + } + rcu_read_unlock(); +} + static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi) { struct drbd_conf *mdev; @@ -1372,7 +1388,7 @@ static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi) case WO_bdev_flush: case WO_drain_io: - drbd_wait_ee_list_empty(mdev, &mdev->active_ee); + conn_wait_active_ee_empty(tconn); drbd_flush(tconn); if (atomic_read(&tconn->current_epoch->epoch_size)) { |