From: Jens Axboe <axboe@kernel.dk>
To: Hao Xu <haoxu@linux.alibaba.com>
Cc: io-uring@vger.kernel.org, Pavel Begunkov <asml.silence@gmail.com>,
Joseph Qi <joseph.qi@linux.alibaba.com>
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: <787db207-fc62-430c-d0ff-4fc15e957b48@kernel.dk> (raw)
In-Reply-To: <20210820221954.61815-1-haoxu@linux.alibaba.com>
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 \
--in-reply-to=787db207-fc62-430c-d0ff-4fc15e957b48@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--cc=haoxu@linux.alibaba.com \
--cc=io-uring@vger.kernel.org \
--cc=joseph.qi@linux.alibaba.com \
/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).