diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 1 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 27 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 5 |
3 files changed, 27 insertions, 6 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index ab20c0062d21..e0e08f5e0a76 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -829,6 +829,7 @@ enum { | |||
829 | * the peer, if it changed there as well. */ | 829 | * the peer, if it changed there as well. */ |
830 | CONN_DRY_RUN, /* Expect disconnect after resync handshake. */ | 830 | CONN_DRY_RUN, /* Expect disconnect after resync handshake. */ |
831 | GOT_PING_ACK, /* set when we receive a ping_ack packet, misc wait gets woken */ | 831 | GOT_PING_ACK, /* set when we receive a ping_ack packet, misc wait gets woken */ |
832 | NEW_CUR_UUID, /* Create new current UUID when thawing IO */ | ||
832 | }; | 833 | }; |
833 | 834 | ||
834 | struct drbd_bitmap; /* opaque for drbd_conf */ | 835 | struct drbd_bitmap; /* opaque for drbd_conf */ |
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 40baddd94a5b..440b1d5dcfe2 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -1252,12 +1252,23 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, | |||
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | if (fp == FP_STONITH && ns.susp) { | 1254 | if (fp == FP_STONITH && ns.susp) { |
1255 | /* case1: The outdate peer handler is successful: | 1255 | /* case1: The outdate peer handler is successful: */ |
1256 | * case2: The connection was established again: */ | 1256 | if (os.pdsk > D_OUTDATED && ns.pdsk <= D_OUTDATED) { |
1257 | if ((os.pdsk > D_OUTDATED && ns.pdsk <= D_OUTDATED) || | ||
1258 | (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED)) { | ||
1259 | tl_clear(mdev); | 1257 | tl_clear(mdev); |
1258 | if (test_bit(NEW_CUR_UUID, &mdev->flags)) { | ||
1259 | drbd_uuid_new_current(mdev); | ||
1260 | clear_bit(NEW_CUR_UUID, &mdev->flags); | ||
1261 | drbd_md_sync(mdev); | ||
1262 | } | ||
1263 | spin_lock_irq(&mdev->req_lock); | ||
1264 | _drbd_set_state(_NS(mdev, susp, 0), CS_VERBOSE, NULL); | ||
1265 | spin_unlock_irq(&mdev->req_lock); | ||
1266 | } | ||
1267 | /* case2: The connection was established again: */ | ||
1268 | if (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED) { | ||
1269 | clear_bit(NEW_CUR_UUID, &mdev->flags); | ||
1260 | spin_lock_irq(&mdev->req_lock); | 1270 | spin_lock_irq(&mdev->req_lock); |
1271 | _tl_restart(mdev, resend); | ||
1261 | _drbd_set_state(_NS(mdev, susp, 0), CS_VERBOSE, NULL); | 1272 | _drbd_set_state(_NS(mdev, susp, 0), CS_VERBOSE, NULL); |
1262 | spin_unlock_irq(&mdev->req_lock); | 1273 | spin_unlock_irq(&mdev->req_lock); |
1263 | } | 1274 | } |
@@ -1280,8 +1291,12 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, | |||
1280 | if (get_ldev(mdev)) { | 1291 | if (get_ldev(mdev)) { |
1281 | if ((ns.role == R_PRIMARY || ns.peer == R_PRIMARY) && | 1292 | if ((ns.role == R_PRIMARY || ns.peer == R_PRIMARY) && |
1282 | mdev->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { | 1293 | mdev->ldev->md.uuid[UI_BITMAP] == 0 && ns.disk >= D_UP_TO_DATE) { |
1283 | drbd_uuid_new_current(mdev); | 1294 | if (mdev->state.susp) { |
1284 | drbd_send_uuids(mdev); | 1295 | set_bit(NEW_CUR_UUID, &mdev->flags); |
1296 | } else { | ||
1297 | drbd_uuid_new_current(mdev); | ||
1298 | drbd_send_uuids(mdev); | ||
1299 | } | ||
1285 | } | 1300 | } |
1286 | put_ldev(mdev); | 1301 | put_ldev(mdev); |
1287 | } | 1302 | } |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 32d00720470b..d764f3cd5866 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -1810,6 +1810,11 @@ static int drbd_nl_suspend_io(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nl | |||
1810 | static int drbd_nl_resume_io(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp, | 1810 | static int drbd_nl_resume_io(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp, |
1811 | struct drbd_nl_cfg_reply *reply) | 1811 | struct drbd_nl_cfg_reply *reply) |
1812 | { | 1812 | { |
1813 | if (test_bit(NEW_CUR_UUID, &mdev->flags)) { | ||
1814 | drbd_uuid_new_current(mdev); | ||
1815 | clear_bit(NEW_CUR_UUID, &mdev->flags); | ||
1816 | drbd_md_sync(mdev); | ||
1817 | } | ||
1813 | drbd_suspend_io(mdev); | 1818 | drbd_suspend_io(mdev); |
1814 | reply->ret_code = drbd_request_state(mdev, NS(susp, 0)); | 1819 | reply->ret_code = drbd_request_state(mdev, NS(susp, 0)); |
1815 | if (reply->ret_code == SS_SUCCESS) { | 1820 | if (reply->ret_code == SS_SUCCESS) { |