]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/io_uring.c
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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 7 Mar 2022 10:45:52 +0000 (11:45 +0100)
commit68668891f32e9161b734406da8f9668be86aa2f4
treecfd1535af49d11e6e31ffd8d149b3ad83f2d6f84
parent43cbfa019710b1b53b8edc326d7696a5bfd4beeb
io_uring: don't convert to jiffies for waiting on timeouts

BugLink: https://bugs.launchpad.net/bugs/1963891
commit 228339662b398a59b3560cd571deb8b25b253c7e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/io_uring.c