]> git.baikalelectronics.ru Git - kernel.git/commit
drbd: Fix spurious disk-timeout
authorLars Ellenberg <lars.ellenberg@linbit.com>
Fri, 16 Jan 2015 16:41:55 +0000 (17:41 +0100)
committerJens Axboe <axboe@fb.com>
Wed, 25 Nov 2015 16:22:01 +0000 (09:22 -0700)
commit5fa9e8305942642c9106a7666454e3f0258d952b
tree46649bb3f8558c923d2af187affe89ceb82a91fb
parentf48b6773cc232119c0c9f03dc2f5c067e75acbbc
drbd: Fix spurious disk-timeout

(You should not use disk-timeout anyways,
 see the man page for why...)

We add incoming requests to the tail of some ring list.
On local completion, requests are removed from that list.
The timer looks only at the head of that ring list,
so is supposed to only see the oldest request.
All protected by a spinlock.

The request object is created with timestamps zeroed out.
The timestamp was only filled in just before the actual submit.
But to actually submit the request, we need to give up the spinlock.

If you are unlucky, there is no older still pending request, the timer
looks at a new request with timestamp still zero (before it even was
submitted), and 0 + timeout is most likely older than "now".

Better assign the timestamp right when we put the
request object on said ring list.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/drbd/drbd_req.c