diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-12-13 10:36:57 (GMT) |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 15:58:12 (GMT) |
commit | e8cdc3433568a1741e95c1d4412a7fb9736d0eac (patch) | |
tree | 3ec01ced9ac8201f23f7e659a6c4b15b88ae018b /drivers/block/drbd/drbd_req.c | |
parent | 6ab9b1b60b1854bf5fe68ecd51cb9550c67801ec (diff) | |
download | linux-e8cdc3433568a1741e95c1d4412a7fb9736d0eac.tar.xz |
drbd: Consider that read requests could be NEG_ACKEDed
ap_in_flight only counts writes. NEG_ACKED is an action
on a request that might be called for reads and writes.
This bug was there forever, but it becomes much more
relevant with the read balincing code.
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_req.c')
-rw-r--r-- | drivers/block/drbd/drbd_req.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index b1957d6..cf3c10e 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -628,7 +628,8 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, /* assert something? */ if (req->rq_state & RQ_NET_PENDING) { dec_ap_pending(mdev); - atomic_sub(req->i.size >> 9, &mdev->ap_in_flight); + if (req->rq_state & RQ_WRITE) + atomic_sub(req->i.size >> 9, &mdev->ap_in_flight); } req->rq_state &= ~(RQ_NET_OK|RQ_NET_PENDING); |