From: Jens Axboe <[email protected]>
To: Hao Xu <[email protected]>
Cc: [email protected], Pavel Begunkov <[email protected]>,
Joseph Qi <[email protected]>
Subject: Re: [PATCH for-5.15 v2] io_uring: fix lacking of protection for compl_nr
Date: Fri, 20 Aug 2021 16:23:48 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 8/20/21 4:19 PM, Hao Xu wrote:
> coml_nr in ctx_flush_and_put() is not protected by uring_lock, this
> may cause problems when accessing it parallelly:
>
> say coml_nr > 0
>
> ctx_flush_and put other context
> if (compl_nr) get mutex
> coml_nr > 0
> do flush
> coml_nr = 0
> release mutex
> get mutex
> do flush (*)
> release mutex
>
> in (*) place, we call io_cqring_ev_posted() and users likely get
> none events there.
Applied, thanks.
--
Jens Axboe
prev parent reply other threads:[~2021-08-20 22:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-20 22:19 [PATCH for-5.15 v2] io_uring: fix lacking of protection for compl_nr Hao Xu
2021-08-20 22:23 ` 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 \
[email protected] \
[email protected] \
[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