Skip to content

Commit

Permalink
drbd: Do not mod_timer() with a past time
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Philipp Reisner committed Nov 8, 2012
1 parent 3fb4746 commit 3b03ad5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

0 comments on commit 3b03ad5

Please sign in to comment.