diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2012-06-08 08:09:54 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-06-12 08:34:51 -0400 |
commit | 1ed25b269e3dd5ecc64f17beef9ea21745c39ca6 (patch) | |
tree | a311e656c28d4946ddb0849f1a4e42839706e990 /drivers/block | |
parent | 4eccc579795290a58e2262fa4e9d083d7672e699 (diff) |
drbd: fix list corruption by failing but already aborted reads
If a read is aborted due to force-detach of a supposedly unresponsive
local backing device, and retried on the peer, it can happen that the
local request later still completes (hopefully with an error).
As it may already have been completed to upper layers meanwhile,
it must not be retried again now.
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.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 9c5c84946b05..773f4e2d3c1b 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
@@ -472,12 +472,17 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, | |||
472 | req->rq_state |= RQ_LOCAL_COMPLETED; | 472 | req->rq_state |= RQ_LOCAL_COMPLETED; |
473 | req->rq_state &= ~RQ_LOCAL_PENDING; | 473 | req->rq_state &= ~RQ_LOCAL_PENDING; |
474 | 474 | ||
475 | D_ASSERT(!(req->rq_state & RQ_NET_MASK)); | 475 | if (req->rq_state & RQ_LOCAL_ABORTED) { |
476 | _req_may_be_done(req, m); | ||
477 | break; | ||
478 | } | ||
476 | 479 | ||
477 | __drbd_chk_io_error(mdev, false); | 480 | __drbd_chk_io_error(mdev, false); |
478 | 481 | ||
479 | goto_queue_for_net_read: | 482 | goto_queue_for_net_read: |
480 | 483 | ||
484 | D_ASSERT(!(req->rq_state & RQ_NET_MASK)); | ||
485 | |||
481 | /* no point in retrying if there is no good remote data, | 486 | /* no point in retrying if there is no good remote data, |
482 | * or we have no connection. */ | 487 | * or we have no connection. */ |
483 | if (mdev->state.pdsk != D_UP_TO_DATE) { | 488 | if (mdev->state.pdsk != D_UP_TO_DATE) { |