Commit 2415308e authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

drbd: move put_ldev from __req_mod() to the endio callback

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 6870ca6d
...@@ -416,7 +416,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -416,7 +416,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
maybe_wakeup_conflicting_requests(req); maybe_wakeup_conflicting_requests(req);
req_may_be_completed_not_susp(req, m); req_may_be_completed_not_susp(req, m);
put_ldev(mdev);
break; break;
case ABORT_DISK_IO: case ABORT_DISK_IO:
...@@ -434,7 +433,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -434,7 +433,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
__drbd_chk_io_error(mdev, false); __drbd_chk_io_error(mdev, false);
maybe_wakeup_conflicting_requests(req); maybe_wakeup_conflicting_requests(req);
req_may_be_completed_not_susp(req, m); req_may_be_completed_not_susp(req, m);
put_ldev(mdev);
break; break;
case READ_AHEAD_COMPLETED_WITH_ERROR: case READ_AHEAD_COMPLETED_WITH_ERROR:
...@@ -442,7 +440,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -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_COMPLETED;
req->rq_state &= ~RQ_LOCAL_PENDING; req->rq_state &= ~RQ_LOCAL_PENDING;
req_may_be_completed_not_susp(req, m); req_may_be_completed_not_susp(req, m);
put_ldev(mdev);
break; break;
case READ_COMPLETED_WITH_ERROR: case READ_COMPLETED_WITH_ERROR:
...@@ -454,7 +451,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -454,7 +451,6 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
D_ASSERT(!(req->rq_state & RQ_NET_MASK)); D_ASSERT(!(req->rq_state & RQ_NET_MASK));
__drbd_chk_io_error(mdev, false); __drbd_chk_io_error(mdev, false);
put_ldev(mdev);
goto_queue_for_net_read: goto_queue_for_net_read:
......
...@@ -238,6 +238,7 @@ void drbd_request_endio(struct bio *bio, int error) ...@@ -238,6 +238,7 @@ void drbd_request_endio(struct bio *bio, int error)
spin_lock_irqsave(&mdev->tconn->req_lock, flags); spin_lock_irqsave(&mdev->tconn->req_lock, flags);
__req_mod(req, what, &m); __req_mod(req, what, &m);
spin_unlock_irqrestore(&mdev->tconn->req_lock, flags); spin_unlock_irqrestore(&mdev->tconn->req_lock, flags);
put_ldev(mdev);
if (m.bio) if (m.bio)
complete_master_bio(mdev, &m); complete_master_bio(mdev, &m);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment