Commit ff3c3ecd authored by Jens Axboe's avatar Jens Axboe Committed by Greg Kroah-Hartman
Browse files

UPSTREAM: io_uring: io_kiocb_update_pos() should not touch file for non -1 offset



commit 6f83ab22 upstream.

-1 tells use to use the current position, but we check if the file is
a stream regardless of that. Fix up io_kiocb_update_pos() to only
dip into file if we need to. This is both more efficient and also drops
12 bytes of text on aarch64 and 64 bytes on x86-64.

Fixes: b4aec400 ("io_uring: do not recalculate ppos unnecessarily")
Change-Id: I5c22ce8122b0e1f0ad423a5b3aa520ee416feff1
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 268174392
(cherry picked from commit 89a77271)
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent fd357886
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment