public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Linus Torvalds <[email protected]>
Cc: io-uring <[email protected]>
Subject: Re: [GIT PULL] io_uring fix for 5.16-rc7
Date: Thu, 23 Dec 2021 16:49:45 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHk-=wj-fA6Sp+dNaSkadCg0sgB2fKW7Wi=f8DoG+GmiM2_shA@mail.gmail.com>

On 12/23/21 4:39 PM, Linus Torvalds wrote:
> On Thu, Dec 23, 2021 at 1:11 PM Jens Axboe <[email protected]> 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


  parent reply	other threads:[~2021-12-23 23:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-23 21:11 [GIT PULL] io_uring fix for 5.16-rc7 Jens Axboe
2021-12-23 23:39 ` Linus Torvalds
2021-12-23 23:43   ` Linus Torvalds
2021-12-24  0:55     ` Jens Axboe
2021-12-23 23:49   ` Jens Axboe [this message]
2021-12-23 23:46 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox