Re: [PATCH] io_uring: kiocb_done() should *not* trust ->ki_pos if ->{read,write}_iter() failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 26, 2023 at 03:18:40AM +0100, Al Viro wrote:
> [in viro/vfs.git#fixes at the moment]
> ->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.
> 
> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> ---

Looks good to me,
Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx>




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux