drbd: make OOS_HANDED_TO_NETWORK its own case
authorLars Ellenberg <lars.ellenberg@linbit.com>
Wed, 11 Jan 2012 08:43:25 +0000 (09:43 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Wed, 9 May 2012 13:16:47 +0000 (15:16 +0200)
OOS_HANDED_TO_NETWORK should not be grouped with the various
*_CANCELED/*_FAILED cases.
Also, not only clear the RQ_NET_QUEUED flag, but also mark it RQ_NET_DONE,
so it can be distinguished from a local-only request even after that.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_req.c

index de319ba54241d895e34dc0de568701b1b4f9b3e9..bfed0834cd6ffcfe07b31c46072d17b6b245c667 100644 (file)
@@ -569,10 +569,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
                drbd_queue_work(&mdev->data.work, &req->w);
                break;
 
-       case oos_handed_to_network:
-               /* actually the same */
        case send_canceled:
-               /* treat it the same */
        case send_failed:
                /* real cleanup will be done from tl_clear.  just update flags
                 * so it is no longer marked as on the worker queue */
@@ -602,11 +599,14 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
                }
                req->rq_state &= ~RQ_NET_QUEUED;
                req->rq_state |= RQ_NET_SENT;
-               /* because _drbd_send_zc_bio could sleep, and may want to
-                * dereference the bio even after the "write_acked_by_peer" and
-                * "completed_ok" events came in, once we return from
-                * _drbd_send_zc_bio (drbd_send_dblock), we have to check
-                * whether it is done already, and end it.  */
+               _req_may_be_done_not_susp(req, m);
+               break;
+
+       case oos_handed_to_network:
+               /* Was not set PENDING, no longer QUEUED, so is now DONE
+                * as far as this connection is concerned. */
+               req->rq_state &= ~RQ_NET_QUEUED;
+               req->rq_state |= RQ_NET_DONE;
                _req_may_be_done_not_susp(req, m);
                break;