summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-07-24 09:31:18 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:58:37 +0100
commit934722a2dbf87b43d39c787441e511157d5add94 (patch)
treec41a5b34433473068596cf237176dba269af1d5f /drivers/block
parenta0d856dfaed16efb9600b2a7d147cb6dbc11ff94 (diff)
downloadblackbird-op-linux-934722a2dbf87b43d39c787441e511157d5add94.tar.gz
blackbird-op-linux-934722a2dbf87b43d39c787441e511157d5add94.zip
drbd: __req_mod: make DISCARD_WRITE and independend case
cherry-picked and adapted from drbd 9 devel branch This looks cleaner to me, and also gets rid of the other ugly if-inside-case-fall-through. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_req.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 329528d9dec7..f2ba43e78377 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -609,13 +609,19 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
case DISCARD_WRITE:
/* for discarded conflicting writes of multiple primaries,
* there is no need to keep anything in the tl, potential
- * node crashes are covered by the activity log. */
- mod_rq_state(req, NULL, 0, RQ_NET_DONE);
- /* fall through */
+ * node crashes are covered by the activity log.
+ *
+ * If this request had been marked as RQ_POSTPONED before,
+ * it will actually not be discarded, but "restarted",
+ * resubmitted from the retry worker context. */
+ D_ASSERT(req->rq_state & RQ_NET_PENDING);
+ D_ASSERT(req->rq_state & RQ_EXP_WRITE_ACK);
+ mod_rq_state(req, m, RQ_NET_PENDING, RQ_NET_DONE|RQ_NET_OK);
+ break;
+
case WRITE_ACKED_BY_PEER_AND_SIS:
+ req->rq_state |= RQ_NET_SIS;
case WRITE_ACKED_BY_PEER:
- if (what == WRITE_ACKED_BY_PEER_AND_SIS)
- req->rq_state |= RQ_NET_SIS;
D_ASSERT(req->rq_state & RQ_EXP_WRITE_ACK);
/* protocol C; successfully written on peer.
* Nothing more to do here.
OpenPOWER on IntegriCloud