drbd: Now we need to handle the ed_uuid of an diskless, unconnected primary correctly
authorPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 21 Jun 2010 12:14:15 +0000 (14:14 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 14 Oct 2010 12:56:00 +0000 (14:56 +0200)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_receiver.c

index 106b9abdc430d7335b643b2ace25aa873b9589a7..c701805ed4b91e7fface02c792504296b517d302 100644 (file)
@@ -1297,8 +1297,10 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
        }
 
        if (ns.pdsk < D_INCONSISTENT && get_ldev(mdev)) {
-               if (ns.peer == R_PRIMARY && mdev->ldev->md.uuid[UI_BITMAP] == 0)
+               if (ns.peer == R_PRIMARY && mdev->ldev->md.uuid[UI_BITMAP] == 0) {
                        drbd_uuid_new_current(mdev);
+                       drbd_send_uuids(mdev);
+               }
 
                /* D_DISKLESS Peer becomes secondary */
                if (os.peer == R_PRIMARY && ns.peer == R_SECONDARY)
index 8daa920c40a4daf50e83b1a94d21ac633c03c363..72bc1a130645827174cafe5767bf08889b9cab95 100644 (file)
@@ -3104,6 +3104,11 @@ static int receive_uuids(struct drbd_conf *mdev, struct p_header *h)
                        drbd_md_sync(mdev);
                }
                put_ldev(mdev);
+       } else if (mdev->state.disk < D_INCONSISTENT &&
+                  mdev->state.role == R_PRIMARY) {
+               /* I am a diskless primary, the peer just created a new current UUID
+                  for me. */
+               drbd_set_ed_uuid(mdev, p_uuid[UI_CURRENT]);
        }
 
        /* Before we test for the disk state, we should wait until an eventually