]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't convert to jiffies for waiting on timeouts
authorJens Axboe <axboe@kernel.dk>
Mon, 21 Feb 2022 12:49:30 +0000 (05:49 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 21 Feb 2022 12:55:42 +0000 (05:55 -0700)
commit213c1be8706f25423233651b8812345e14e925d6
tree059cd282c54b5d4370d2837a46b5fee563c880d1
parent3dbad33cca79c4b9c0d328c7d5e48aa2ba494be7
io_uring: don't convert to jiffies for waiting on timeouts

If an application calls io_uring_enter(2) with a timespec passed in,
convert that timespec to ktime_t rather than jiffies. The latter does
not provide the granularity the application may expect, and may in
fact provided different granularity on different systems, depending
on what the HZ value is configured at.

Turn the timespec into an absolute ktime_t, and use that with
schedule_hrtimeout() instead.

Link: https://github.com/axboe/liburing/issues/531
Cc: stable@vger.kernel.org
Reported-by: Bob Chen <chenbo.chen@alibaba-inc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c