summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_state.c
diff options
context:
space:
mode:
authorPhilipp Reisner2012-08-07 13:28:00 +0200
committerPhilipp Reisner2012-11-09 14:05:47 +0100
commit8a0bab2a6dd05ee35777370be892daba01750712 (patch)
treeb3111de93bd73df69ee330551c5f55636ae0c0e9 /drivers/block/drbd/drbd_state.c
parentdrbd: Fix a potential issue with the DISCARD_CONCURRENT flag (diff)
downloadkernel-qcow2-linux-8a0bab2a6dd05ee35777370be892daba01750712.tar.gz
kernel-qcow2-linux-8a0bab2a6dd05ee35777370be892daba01750712.tar.xz
kernel-qcow2-linux-8a0bab2a6dd05ee35777370be892daba01750712.zip
drbd: Finish requests that completed while IO was frozen
Requests of an acked epoch are stored on the barrier_acked_requests list. In case the private bio of such a request completes while IO on the drbd device is suspended [req_mod(completed_ok)] then the request stays there. When thawing IO because the fence_peer handler returned, then we use tl_clear() to apply the connection_lost_while_pending event to all requests on the transfer-log and the barrier_acked_requests list. Up to now the connection_lost_while_pending event was not applied on requests on the barrier_acked_requests list. Fixed that. I.e. now the connection_lost_while_pending and resend events are applied to requests on the barrier_acked_requests list. For that it is necessary that the resend event finishes (local only) READS correctly. 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_state.c')
-rw-r--r--drivers/block/drbd/drbd_state.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 12f2b4fbe559..c16349aec23c 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -1503,7 +1503,6 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused)
if (ns_max.susp_fen) {
/* case1: The outdate peer handler is successful: */
if (ns_max.pdsk <= D_OUTDATED) {
- tl_clear(tconn);
rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, vnr) {
if (test_bit(NEW_CUR_UUID, &mdev->flags)) {
@@ -1512,10 +1511,13 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused)
}
}
rcu_read_unlock();
- conn_request_state(tconn,
- (union drbd_state) { { .susp_fen = 1 } },
- (union drbd_state) { { .susp_fen = 0 } },
- CS_VERBOSE);
+ spin_lock_irq(&tconn->req_lock);
+ _tl_restart(tconn, CONNECTION_LOST_WHILE_PENDING);
+ _conn_request_state(tconn,
+ (union drbd_state) { { .susp_fen = 1 } },
+ (union drbd_state) { { .susp_fen = 0 } },
+ CS_VERBOSE);
+ spin_unlock_irq(&tconn->req_lock);
}
/* case2: The connection was established again: */
if (ns_min.conn >= C_CONNECTED) {