From: Jens Axboe <axboe@kernel.dk>
To: "Stefan Bühler" <source@stbuehler.de>,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/1] io_uring: fix race condition reading SQE data
Date: Mon, 13 May 2019 09:15:59 -0600 [thread overview]
Message-ID: <3c0071d2-528b-573a-49fe-c6f72398840c@kernel.dk> (raw)
In-Reply-To: <20190511170801.32182-1-source@stbuehler.de>
On 5/11/19 11:08 AM, Stefan Bühler wrote:
> When punting to workers the SQE gets copied after the initial try.
> There is a race condition between reading SQE data for the initial try
> and copying it for punting it to the workers.
>
> For example io_rw_done calls kiocb->ki_complete even if it was prepared
> for IORING_OP_FSYNC (and would be NULL).
>
> The easiest solution for now is to alway prepare again in the worker.
>
> req->file is safe to prepare though as long as it is checked before use.
Looks good, as we discussed a week or so ago. Applied, thanks.
--
Jens Axboe
prev parent reply other threads:[~2019-05-13 15:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 10:22 io_uring: REQ_F_PREPPED race condition with punting to workers Stefan Bühler
2019-05-03 14:48 ` Jens Axboe
2019-05-11 17:08 ` [PATCH 1/1] io_uring: fix race condition reading SQE data Stefan Bühler
2019-05-13 15:15 ` Jens Axboe [this message]
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 \
--in-reply-to=3c0071d2-528b-573a-49fe-c6f72398840c@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=source@stbuehler.de \
/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;
as well as URLs for NNTP newsgroup(s).