提交 2415308e 编写于 作者: L Lars Ellenberg 提交者: Philipp Reisner

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

Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册