aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_req.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-06-14 08:21:32 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-07-24 08:06:18 -0400
commit383606e0dea6a380097dbcb0c319b09ca372f36b (patch)
tree170c3c95c12bd0a3e6cca0b7d13a4c4cc91f040e /drivers/block/drbd/drbd_req.c
parentd264580145a0aee2f5113c37b178a55b6e1b0b32 (diff)
drbd: differentiate between normal and forced detach
Aborting local requests (not waiting for completion from the lower level disk) is dangerous: if the master bio has been completed to upper layers, data pages may be re-used for other things already. If local IO is still pending and later completes, this may cause crashes or corrupt unrelated data. Only abort local IO if explicitly requested. Intended use case is a lower level device that turned into a tarpit, not completing io requests, not even doing error completion. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_req.c')
-rw-r--r--drivers/block/drbd/drbd_req.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 8e93a6ac9bb..1f4b2dbb7d4 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -455,7 +455,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
455 req->rq_state |= RQ_LOCAL_COMPLETED; 455 req->rq_state |= RQ_LOCAL_COMPLETED;
456 req->rq_state &= ~RQ_LOCAL_PENDING; 456 req->rq_state &= ~RQ_LOCAL_PENDING;
457 457
458 __drbd_chk_io_error(mdev, false); 458 __drbd_chk_io_error(mdev, DRBD_IO_ERROR);
459 _req_may_be_done_not_susp(req, m); 459 _req_may_be_done_not_susp(req, m);
460 break; 460 break;
461 461
@@ -477,7 +477,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
477 break; 477 break;
478 } 478 }
479 479
480 __drbd_chk_io_error(mdev, false); 480 __drbd_chk_io_error(mdev, DRBD_IO_ERROR);
481 481
482 goto_queue_for_net_read: 482 goto_queue_for_net_read:
483 483
@@ -1275,7 +1275,7 @@ void request_timer_fn(unsigned long data)
1275 time_after(now, req->start_time + dt) && 1275 time_after(now, req->start_time + dt) &&
1276 !time_in_range(now, mdev->last_reattach_jif, mdev->last_reattach_jif + dt)) { 1276 !time_in_range(now, mdev->last_reattach_jif, mdev->last_reattach_jif + dt)) {
1277 dev_warn(DEV, "Local backing device failed to meet the disk-timeout\n"); 1277 dev_warn(DEV, "Local backing device failed to meet the disk-timeout\n");
1278 __drbd_chk_io_error(mdev, 1); 1278 __drbd_chk_io_error(mdev, DRBD_FORCE_DETACH);
1279 } 1279 }
1280 nt = (time_after(now, req->start_time + et) ? now : req->start_time) + et; 1280 nt = (time_after(now, req->start_time + et) ? now : req->start_time) + et;
1281 spin_unlock_irq(&mdev->req_lock); 1281 spin_unlock_irq(&mdev->req_lock);