Commit fd2491f4 authored by Philipp Reisner's avatar Philipp Reisner

drbd: detach must not try to abort non-local requests from drbd-8.4

Cherry picked form 8.4
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 79f16f5d
...@@ -344,7 +344,7 @@ void tl_release(struct drbd_conf *mdev, unsigned int barrier_nr, ...@@ -344,7 +344,7 @@ void tl_release(struct drbd_conf *mdev, unsigned int barrier_nr,
* @what: The action/event to perform with all request objects * @what: The action/event to perform with all request objects
* *
* @what might be one of connection_lost_while_pending, resend, fail_frozen_disk_io, * @what might be one of connection_lost_while_pending, resend, fail_frozen_disk_io,
* restart_frozen_disk_io, abort_disk_io. * restart_frozen_disk_io.
*/ */
static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what) static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
{ {
...@@ -368,12 +368,6 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what) ...@@ -368,12 +368,6 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
} }
tmp = b->next; tmp = b->next;
if (what == abort_disk_io) {
/* Only walk the TL, leave barrier objects in place */
b = tmp;
continue;
}
if (n_writes) { if (n_writes) {
if (what == resend) { if (what == resend) {
b->n_writes = n_writes; b->n_writes = n_writes;
...@@ -422,7 +416,6 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what) ...@@ -422,7 +416,6 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
/* Actions operating on the disk state, also want to work on /* Actions operating on the disk state, also want to work on
requests that got barrier acked. */ requests that got barrier acked. */
switch (what) { switch (what) {
case abort_disk_io:
case fail_frozen_disk_io: case fail_frozen_disk_io:
case restart_frozen_disk_io: case restart_frozen_disk_io:
list_for_each_safe(le, tle, &mdev->barrier_acked_requests) { list_for_each_safe(le, tle, &mdev->barrier_acked_requests) {
...@@ -482,6 +475,38 @@ void tl_restart(struct drbd_conf *mdev, enum drbd_req_event what) ...@@ -482,6 +475,38 @@ void tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
spin_unlock_irq(&mdev->req_lock); spin_unlock_irq(&mdev->req_lock);
} }
/**
* tl_abort_disk_io() - Abort disk I/O for all requests for a certain mdev in the TL
* @mdev: DRBD device.
*/
void tl_abort_disk_io(struct drbd_conf *mdev)
{
struct drbd_tl_epoch *b;
struct list_head *le, *tle;
struct drbd_request *req;
spin_lock_irq(&mdev->req_lock);
b = mdev->oldest_tle;
while (b) {
list_for_each_safe(le, tle, &b->requests) {
req = list_entry(le, struct drbd_request, tl_requests);
if (!(req->rq_state & RQ_LOCAL_PENDING))
continue;
_req_mod(req, abort_disk_io);
}
b = b->next;
}
list_for_each_safe(le, tle, &mdev->barrier_acked_requests) {
req = list_entry(le, struct drbd_request, tl_requests);
if (!(req->rq_state & RQ_LOCAL_PENDING))
continue;
_req_mod(req, abort_disk_io);
}
spin_unlock_irq(&mdev->req_lock);
}
/** /**
* cl_wide_st_chg() - true if the state change is a cluster wide one * cl_wide_st_chg() - true if the state change is a cluster wide one
* @mdev: DRBD device. * @mdev: DRBD device.
...@@ -1577,7 +1602,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, ...@@ -1577,7 +1602,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
/* Immediately allow completion of all application IO, that waits /* Immediately allow completion of all application IO, that waits
for completion from the local disk. */ for completion from the local disk. */
tl_restart(mdev, abort_disk_io); tl_abort_disk_io(mdev);
/* current state still has to be D_FAILED, /* current state still has to be D_FAILED,
* there is only one way out: to D_DISKLESS, * there is only one way out: to D_DISKLESS,
......
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