aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/drbd/drbd_nl.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 23670d81ec32..ceebd31eddb9 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -655,7 +655,6 @@ drbd_set_role(struct drbd_device *const device, enum drbd_role new_role, int for
655 /* FIXME also wait for all pending P_BARRIER_ACK? */ 655 /* FIXME also wait for all pending P_BARRIER_ACK? */
656 656
657 if (new_role == R_SECONDARY) { 657 if (new_role == R_SECONDARY) {
658 set_disk_ro(device->vdisk, true);
659 if (get_ldev(device)) { 658 if (get_ldev(device)) {
660 device->ldev->md.uuid[UI_CURRENT] &= ~(u64)1; 659 device->ldev->md.uuid[UI_CURRENT] &= ~(u64)1;
661 put_ldev(device); 660 put_ldev(device);
@@ -667,7 +666,6 @@ drbd_set_role(struct drbd_device *const device, enum drbd_role new_role, int for
667 nc->discard_my_data = 0; /* without copy; single bit op is atomic */ 666 nc->discard_my_data = 0; /* without copy; single bit op is atomic */
668 mutex_unlock(&device->resource->conf_update); 667 mutex_unlock(&device->resource->conf_update);
669 668
670 set_disk_ro(device->vdisk, false);
671 if (get_ldev(device)) { 669 if (get_ldev(device)) {
672 if (((device->state.conn < C_CONNECTED || 670 if (((device->state.conn < C_CONNECTED ||
673 device->state.pdsk <= D_FAILED) 671 device->state.pdsk <= D_FAILED)
@@ -690,7 +688,7 @@ drbd_set_role(struct drbd_device *const device, enum drbd_role new_role, int for
690 } 688 }
691 689
692 drbd_md_sync(device); 690 drbd_md_sync(device);
693 691 set_disk_ro(device->vdisk, new_role == R_SECONDARY);
694 kobject_uevent(&disk_to_dev(device->vdisk)->kobj, KOBJ_CHANGE); 692 kobject_uevent(&disk_to_dev(device->vdisk)->kobj, KOBJ_CHANGE);
695out: 693out:
696 mutex_unlock(device->state_mutex); 694 mutex_unlock(device->state_mutex);