aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2012-08-27 11:20:12 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-09 08:08:22 -0500
commit892fdd1aee35803bfa41ccf4df850ddb70f0811c (patch)
treeda4150805ff7aa465af7668b138384407b0b09e7
parent88f79ec4ae22a82d7b9a0cd4c9f3ee1def2a382c (diff)
drbd: Improve readability of IO resuming after freeze due to no data access
The previous way of doing the state change was also okay since the state change on the susp flag gets propagated from the mdev to the tconn. Fortunately all this goes away in drbd-9.0 Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_state.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index 60dde030123b..f3e6090d462b 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -1187,21 +1187,25 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1187 state change. This function might sleep */ 1187 state change. This function might sleep */
1188 1188
1189 if (ns.susp_nod) { 1189 if (ns.susp_nod) {
1190 struct drbd_tconn *tconn = mdev->tconn;
1190 enum drbd_req_event what = NOTHING; 1191 enum drbd_req_event what = NOTHING;
1191 1192
1192 if (os.conn < C_CONNECTED && conn_lowest_conn(mdev->tconn) >= C_CONNECTED) 1193 spin_lock_irq(&tconn->req_lock);
1194 if (os.conn < C_CONNECTED && conn_lowest_conn(tconn) >= C_CONNECTED)
1193 what = RESEND; 1195 what = RESEND;
1194 1196
1195 if ((os.disk == D_ATTACHING || os.disk == D_NEGOTIATING) && 1197 if ((os.disk == D_ATTACHING || os.disk == D_NEGOTIATING) &&
1196 conn_lowest_disk(mdev->tconn) > D_NEGOTIATING) 1198 conn_lowest_disk(tconn) > D_NEGOTIATING)
1197 what = RESTART_FROZEN_DISK_IO; 1199 what = RESTART_FROZEN_DISK_IO;
1198 1200
1199 if (what != NOTHING) { 1201 if (tconn->susp_nod && what != NOTHING) {
1200 spin_lock_irq(&mdev->tconn->req_lock); 1202 _tl_restart(tconn, what);
1201 _tl_restart(mdev->tconn, what); 1203 _conn_request_state(tconn,
1202 _drbd_set_state(_NS(mdev, susp_nod, 0), CS_VERBOSE, NULL); 1204 (union drbd_state) { { .susp_nod = 1 } },
1203 spin_unlock_irq(&mdev->tconn->req_lock); 1205 (union drbd_state) { { .susp_nod = 0 } },
1206 CS_VERBOSE);
1204 } 1207 }
1208 spin_unlock_irq(&tconn->req_lock);
1205 } 1209 }
1206 1210
1207 if (ns.susp_fen) { 1211 if (ns.susp_fen) {