Re: [GIT PULL] io_uring fix for 5.16-rc7

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

 



On 12/23/21 4:39 PM, Linus Torvalds wrote:
> On Thu, Dec 23, 2021 at 1:11 PM Jens Axboe <axboe@xxxxxxxxx> wrote:
>>
>> Single fix for not clearing kiocb->ki_pos back to 0 for a stream,
>> destined for stable as well.
> 
> I don't think any of this is right.
> 
> You can't use f_pos without using fdget_pos() to actually get the lock
> to it.
> 
> Which you don't do in io_uring.

Well, current position doesn't really make much sense to begin with in
an async API, but there are various use cases that want to use it for
sync IO. We do have the file at that point, but it's most certainly not
sychronized across completions (or serialized with other fdget_pos()
users).

We could hold ->f_pos_lock over the duration of the IO however, that
would probably be saner... As completions are always done from the task
itself as well, that should work. I'll take a look at that for 5.17.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux