diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-01-20 07:25:21 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:48:01 -0500 |
commit | 62b0da3a244ac33d25a77861ef1cc0080103f2ff (patch) | |
tree | a4313df7c46ac50d751fb0798323e34a3e4efbee /drivers/block/drbd/drbd_receiver.c | |
parent | d07c9c10e5620c632aae9cac2b609033398f6139 (diff) |
drbd: log UUIDs whenever they change
All decisions about sync, sync direction, and wether or not to
allow a connect or attach are based on our set of UUIDs to tag a
data generation.
Log changes to the UUIDs whenever they occur,
logging "new current UUID P:Q:R:S" is more useful
than "Creating new current UUID".
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 | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index e9354931eace..e5686a81f42c 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -3024,7 +3024,7 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned | |||
3024 | { | 3024 | { |
3025 | struct p_uuids *p = &mdev->data.rbuf.uuids; | 3025 | struct p_uuids *p = &mdev->data.rbuf.uuids; |
3026 | u64 *p_uuid; | 3026 | u64 *p_uuid; |
3027 | int i; | 3027 | int i, updated_uuids = 0; |
3028 | 3028 | ||
3029 | p_uuid = kmalloc(sizeof(u64)*UI_EXTENDED_SIZE, GFP_NOIO); | 3029 | p_uuid = kmalloc(sizeof(u64)*UI_EXTENDED_SIZE, GFP_NOIO); |
3030 | 3030 | ||
@@ -3059,13 +3059,14 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned | |||
3059 | _drbd_set_state(_NS2(mdev, disk, D_UP_TO_DATE, pdsk, D_UP_TO_DATE), | 3059 | _drbd_set_state(_NS2(mdev, disk, D_UP_TO_DATE, pdsk, D_UP_TO_DATE), |
3060 | CS_VERBOSE, NULL); | 3060 | CS_VERBOSE, NULL); |
3061 | drbd_md_sync(mdev); | 3061 | drbd_md_sync(mdev); |
3062 | updated_uuids = 1; | ||
3062 | } | 3063 | } |
3063 | put_ldev(mdev); | 3064 | put_ldev(mdev); |
3064 | } else if (mdev->state.disk < D_INCONSISTENT && | 3065 | } else if (mdev->state.disk < D_INCONSISTENT && |
3065 | mdev->state.role == R_PRIMARY) { | 3066 | mdev->state.role == R_PRIMARY) { |
3066 | /* I am a diskless primary, the peer just created a new current UUID | 3067 | /* I am a diskless primary, the peer just created a new current UUID |
3067 | for me. */ | 3068 | for me. */ |
3068 | drbd_set_ed_uuid(mdev, p_uuid[UI_CURRENT]); | 3069 | updated_uuids = drbd_set_ed_uuid(mdev, p_uuid[UI_CURRENT]); |
3069 | } | 3070 | } |
3070 | 3071 | ||
3071 | /* Before we test for the disk state, we should wait until an eventually | 3072 | /* Before we test for the disk state, we should wait until an eventually |
@@ -3074,7 +3075,10 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned | |||
3074 | new disk state... */ | 3075 | new disk state... */ |
3075 | wait_event(mdev->misc_wait, !test_bit(CLUSTER_ST_CHANGE, &mdev->flags)); | 3076 | wait_event(mdev->misc_wait, !test_bit(CLUSTER_ST_CHANGE, &mdev->flags)); |
3076 | if (mdev->state.conn >= C_CONNECTED && mdev->state.disk < D_INCONSISTENT) | 3077 | if (mdev->state.conn >= C_CONNECTED && mdev->state.disk < D_INCONSISTENT) |
3077 | drbd_set_ed_uuid(mdev, p_uuid[UI_CURRENT]); | 3078 | updated_uuids |= drbd_set_ed_uuid(mdev, p_uuid[UI_CURRENT]); |
3079 | |||
3080 | if (updated_uuids) | ||
3081 | drbd_print_uuids(mdev, "receiver updated UUIDs to"); | ||
3078 | 3082 | ||
3079 | return true; | 3083 | return true; |
3080 | } | 3084 | } |
@@ -3305,6 +3309,7 @@ static int receive_sync_uuid(struct drbd_conf *mdev, enum drbd_packets cmd, unsi | |||
3305 | _drbd_uuid_set(mdev, UI_CURRENT, be64_to_cpu(p->uuid)); | 3309 | _drbd_uuid_set(mdev, UI_CURRENT, be64_to_cpu(p->uuid)); |
3306 | _drbd_uuid_set(mdev, UI_BITMAP, 0UL); | 3310 | _drbd_uuid_set(mdev, UI_BITMAP, 0UL); |
3307 | 3311 | ||
3312 | drbd_print_uuids(mdev, "updated sync uuid"); | ||
3308 | drbd_start_resync(mdev, C_SYNC_TARGET); | 3313 | drbd_start_resync(mdev, C_SYNC_TARGET); |
3309 | 3314 | ||
3310 | put_ldev(mdev); | 3315 | put_ldev(mdev); |