Commit 0b2dafcd authored by Philipp Reisner's avatar Philipp Reisner Committed by Jens Axboe

drbd: drop now useless duplicate state request from invalidate

Patch best viewed with git diff --ignore-space-change.

Now that we attempt the fallback to local bitmap operation
only when disconnected, we can safely drop the extra "silent"
state request from both invalidate and invalidate-remote.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 5c4f13d9
...@@ -2446,26 +2446,19 @@ int drbd_adm_invalidate(struct sk_buff *skb, struct genl_info *info) ...@@ -2446,26 +2446,19 @@ int drbd_adm_invalidate(struct sk_buff *skb, struct genl_info *info)
wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags)); wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags));
drbd_flush_workqueue(mdev); drbd_flush_workqueue(mdev);
retcode = _drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_T), CS_ORDERED); /* If we happen to be C_STANDALONE R_SECONDARY, just change to
* D_INCONSISTENT, and set all bits in the bitmap. Otherwise,
/* If that did not work, try again, * try to start a resync handshake as sync target for full sync.
* but log failures this time (implicit CS_VERBOSE).
*
* If we happen to be C_STANDALONE R_SECONDARY,
* just change to D_INCONSISTENT, and set all bits in the bitmap.
* Otherwise, we just fail, to avoid races with the resync handshake.
*/ */
if (retcode < SS_SUCCESS) { if (mdev->state.conn == C_STANDALONE && mdev->state.role == R_SECONDARY) {
if (mdev->state.conn == C_STANDALONE && mdev->state.role == R_SECONDARY) { retcode = drbd_request_state(mdev, NS(disk, D_INCONSISTENT));
retcode = drbd_request_state(mdev, NS(disk, D_INCONSISTENT)); if (retcode >= SS_SUCCESS) {
if (retcode >= SS_SUCCESS) { if (drbd_bitmap_io(mdev, &drbd_bmio_set_n_write,
if (drbd_bitmap_io(mdev, &drbd_bmio_set_n_write, "set_n_write from invalidate", BM_LOCKED_MASK))
"set_n_write from invalidate", BM_LOCKED_MASK)) retcode = ERR_IO_MD_DISK;
retcode = ERR_IO_MD_DISK; }
} } else
} else retcode = drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_T));
retcode = drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_T));
}
drbd_resume_io(mdev); drbd_resume_io(mdev);
out: out:
...@@ -2519,21 +2512,22 @@ int drbd_adm_invalidate_peer(struct sk_buff *skb, struct genl_info *info) ...@@ -2519,21 +2512,22 @@ int drbd_adm_invalidate_peer(struct sk_buff *skb, struct genl_info *info)
wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags)); wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags));
drbd_flush_workqueue(mdev); drbd_flush_workqueue(mdev);
retcode = _drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_S), CS_ORDERED); /* If we happen to be C_STANDALONE R_PRIMARY, just set all bits
if (retcode < SS_SUCCESS) { * in the bitmap. Otherwise, try to start a resync handshake
if (mdev->state.conn == C_STANDALONE && mdev->state.role == R_PRIMARY) { * as sync source for full sync.
/* The peer will get a resync upon connect anyways. Just make that */
into a full resync. */ if (mdev->state.conn == C_STANDALONE && mdev->state.role == R_PRIMARY) {
retcode = drbd_request_state(mdev, NS(pdsk, D_INCONSISTENT)); /* The peer will get a resync upon connect anyways. Just make that
if (retcode >= SS_SUCCESS) { into a full resync. */
if (drbd_bitmap_io(mdev, &drbd_bmio_set_susp_al, retcode = drbd_request_state(mdev, NS(pdsk, D_INCONSISTENT));
"set_n_write from invalidate_peer", if (retcode >= SS_SUCCESS) {
BM_LOCKED_SET_ALLOWED)) if (drbd_bitmap_io(mdev, &drbd_bmio_set_susp_al,
retcode = ERR_IO_MD_DISK; "set_n_write from invalidate_peer",
} BM_LOCKED_SET_ALLOWED))
} else retcode = ERR_IO_MD_DISK;
retcode = drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_S)); }
} } else
retcode = drbd_request_state(mdev, NS(conn, C_STARTING_SYNC_S));
drbd_resume_io(mdev); drbd_resume_io(mdev);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment