aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-05-17 10:10:43 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-05-17 20:03:49 -0400
commit0c3f34516e8c5a1a0ba3585a7777d32bbbdf4ecb (patch)
treebb61a6235de8a6a87ebc4d4f39630d17e3c9a3de /drivers/block/drbd/drbd_receiver.c
parent9a25a04c8079725c1b1ab756694a8e0757844b40 (diff)
drbd: Create new current UUID as late as possible
The choice was to either delay creation of the new UUID until IO got thawed or to delay it until the first IO request. Both are correct, the later is more friendly to users of dual-primary setups, that actually only write on one side. 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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index a04ec01ab3ce..461d9872d4d3 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1150,6 +1150,17 @@ int drbd_submit_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e,
1150 unsigned n_bios = 0; 1150 unsigned n_bios = 0;
1151 unsigned nr_pages = (ds + PAGE_SIZE -1) >> PAGE_SHIFT; 1151 unsigned nr_pages = (ds + PAGE_SIZE -1) >> PAGE_SHIFT;
1152 1152
1153 if (atomic_read(&mdev->new_c_uuid)) {
1154 if (atomic_add_unless(&mdev->new_c_uuid, -1, 1)) {
1155 drbd_uuid_new_current(mdev);
1156 drbd_md_sync(mdev);
1157
1158 atomic_dec(&mdev->new_c_uuid);
1159 wake_up(&mdev->misc_wait);
1160 }
1161 wait_event(mdev->misc_wait, !atomic_read(&mdev->new_c_uuid));
1162 }
1163
1153 /* In most cases, we will only need one bio. But in case the lower 1164 /* In most cases, we will only need one bio. But in case the lower
1154 * level restrictions happen to be different at this offset on this 1165 * level restrictions happen to be different at this offset on this
1155 * side than those of the sending peer, we may need to submit the 1166 * side than those of the sending peer, we may need to submit the