drbd: move put_ldev from __req_mod() to the endio callback
authorLars Ellenberg <lars.ellenberg@linbit.com>
Mon, 26 Mar 2012 15:06:29 +0000 (17:06 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:58:24 +0000 (16:58 +0100)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_req.c
drivers/block/drbd/drbd_worker.c

index f6a785b239a4613befcceda8f2f6564131969bc5..f708aa1809f0eaf8673bcb07d5fd5cbcf7545e79 100644 (file)
@@ -416,7 +416,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
 
                maybe_wakeup_conflicting_requests(req);
                req_may_be_completed_not_susp(req, m);
-               put_ldev(mdev);
                break;
 
        case ABORT_DISK_IO:
@@ -434,7 +433,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
                __drbd_chk_io_error(mdev, false);
                maybe_wakeup_conflicting_requests(req);
                req_may_be_completed_not_susp(req, m);
-               put_ldev(mdev);
                break;
 
        case READ_AHEAD_COMPLETED_WITH_ERROR:
@@ -442,7 +440,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
                req->rq_state |= RQ_LOCAL_COMPLETED;
                req->rq_state &= ~RQ_LOCAL_PENDING;
                req_may_be_completed_not_susp(req, m);
-               put_ldev(mdev);
                break;
 
        case READ_COMPLETED_WITH_ERROR:
@@ -454,7 +451,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
                D_ASSERT(!(req->rq_state & RQ_NET_MASK));
 
                __drbd_chk_io_error(mdev, false);
-               put_ldev(mdev);
 
        goto_queue_for_net_read:
 
index 3adbc5a29702bbf2c3fa5f1938bc4e76635bfeeb..f10451701cdbbf8f45bd82b0f59e87b5fc7f149a 100644 (file)
@@ -238,6 +238,7 @@ void drbd_request_endio(struct bio *bio, int error)
        spin_lock_irqsave(&mdev->tconn->req_lock, flags);
        __req_mod(req, what, &m);
        spin_unlock_irqrestore(&mdev->tconn->req_lock, flags);
+       put_ldev(mdev);
 
        if (m.bio)
                complete_master_bio(mdev, &m);