Skip to content

Commit

Permalink
drbd: fix list corruption by failing but already aborted reads
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Jun 12, 2012
1 parent 4eccc57 commit 1ed25b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,17 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
req->rq_state |= RQ_LOCAL_COMPLETED;
req->rq_state &= ~RQ_LOCAL_PENDING;

D_ASSERT(!(req->rq_state & RQ_NET_MASK));
if (req->rq_state & RQ_LOCAL_ABORTED) {
_req_may_be_done(req, m);
break;
}

__drbd_chk_io_error(mdev, false);

goto_queue_for_net_read:

D_ASSERT(!(req->rq_state & RQ_NET_MASK));

/* no point in retrying if there is no good remote data,
* or we have no connection. */
if (mdev->state.pdsk != D_UP_TO_DATE) {
Expand Down

0 comments on commit 1ed25b2

Please sign in to comment.