Files
linux/io_uring
Al Viro 9eab5008db io_uring: kiocb_done() should *not* trust ->ki_pos if ->{read,write}_iter() failed
[ Upstream commit 1939316bf9 ]

->ki_pos value is unreliable in such cases.  For an obvious example,
consider O_DSYNC write - we feed the data to page cache and start IO,
then we make sure it's completed.  Update of ->ki_pos is dealt with
by the first part; failure in the second ends up with negative value
returned _and_ ->ki_pos left advanced as if sync had been successful.
In the same situation write(2) does not advance the file position
at all.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-08 14:11:02 +01:00
..
2023-08-30 16:11:04 +02:00
2022-09-21 13:15:02 -06:00
2022-07-24 18:39:11 -06:00
2023-08-30 16:11:04 +02:00
2022-07-24 18:39:14 -06:00
2023-05-11 23:03:24 +09:00
2022-10-07 12:25:30 -06:00
2022-09-01 17:39:05 -04:00