public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 1/4] io_uring: io_rw_reissue lockdep annotations
Date: Fri,  8 Jan 2021 20:57:22 +0000	[thread overview]
Message-ID: <0122ce2e04ee78a5cc3f17469d5292a7a987413a.1610139268.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

We expect io_rw_reissue() to take place only during submission with
uring_lock held. Add a lockdep annotation to check that invariant.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index cb57e0360fcb..55ba1922a349 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2692,6 +2692,8 @@ static bool io_rw_reissue(struct io_kiocb *req, long res)
 	if ((res != -EAGAIN && res != -EOPNOTSUPP) || io_wq_current_is_worker())
 		return false;
 
+	lockdep_assert_held(&req->ctx->uring_lock);
+
 	ret = io_sq_thread_acquire_mm_files(req->ctx, req);
 
 	if (io_resubmit_prep(req, ret)) {
-- 
2.24.0


  reply	other threads:[~2021-01-08 21:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 20:57 [PATCH 0/4] fix SQPOLL and exit races Pavel Begunkov
2021-01-08 20:57 ` Pavel Begunkov [this message]
2021-01-08 20:57 ` [PATCH 2/4] io_uring: inline io_uring_attempt_task_drop() Pavel Begunkov
2021-01-08 20:57 ` [PATCH 3/4] io_uring: add warn_once for io_uring_flush() Pavel Begunkov
2021-01-08 20:57 ` [PATCH 4/4] io_uring: stop SQPOLL submit on creator's death Pavel Begunkov

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=0122ce2e04ee78a5cc3f17469d5292a7a987413a.1610139268.git.asml.silence@gmail.com \
    [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