summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-07-15 13:53:06 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:57:57 +0100
commit3b03ad5929e3ba5e1c3db7a70d426f883be061c2 (patch)
treeeae2735de1eeaa875f6cf957d6c4961cbfb7a2dd
parent3fb4746d8d3f9c3e48f7fc65ed24bc54bb8032aa (diff)
drbd: Do not mod_timer() with a past time
In case we can not find out why the request takes too long (happens e.g. when IO got suspended on DRBD level). rearm the timer with a reasonable value. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_req.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 8fa51cda3b7..d0f73b3a679 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1083,7 +1083,7 @@ void request_timer_fn(unsigned long data)
struct drbd_request *req; /* oldest request */
struct list_head *le;
struct net_conf *nc;
- unsigned long ent = 0, dt = 0, et; /* effective timeout = ko_count * timeout */
+ unsigned long ent = 0, dt = 0, et, nt; /* effective timeout = ko_count * timeout */
rcu_read_lock();
nc = rcu_dereference(tconn->net_conf);
@@ -1122,6 +1122,7 @@ void request_timer_fn(unsigned long data)
__drbd_chk_io_error(mdev, 1);
}
}
+ nt = (time_is_before_eq_jiffies(req->start_time + et) ? jiffies : req->start_time) + et;
spin_unlock_irq(&tconn->req_lock);
- mod_timer(&mdev->request_timer, req->start_time + et);
+ mod_timer(&mdev->request_timer, nt);
}