public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 1/8] io_uring: shut io_prep_async_work warning
Date: Tue, 11 Apr 2023 12:06:01 +0100	[thread overview]
Message-ID: <a6cfbe92c74b789c0b4f046f7f98d19b1ca2e5b7.1681210788.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

io_uring/io_uring.c:432 io_prep_async_work() error: we previously
assumed 'req->file' could be null (see line 425).

Even though it's a false positive as there will not be REQ_F_ISREG set
without a file, let's add a simple check to make the kernel test robot
happy. We don't care about performance here, but assumingly it'll be
optimised out by the compiler.

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

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 9bbf58297a0e..b171c26d331d 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -425,7 +425,7 @@ static void io_prep_async_work(struct io_kiocb *req)
 	if (req->file && !io_req_ffs_set(req))
 		req->flags |= io_file_get_flags(req->file) << REQ_F_SUPPORT_NOWAIT_BIT;
 
-	if (req->flags & REQ_F_ISREG) {
+	if (req->file && (req->flags & REQ_F_ISREG)) {
 		bool should_hash = def->hash_reg_file;
 
 		/* don't serialize this request if the fs doesn't need it */
-- 
2.40.0


  reply	other threads:[~2023-04-11 11:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 11:06 [PATCH 0/8] for-next cleanups Pavel Begunkov
2023-04-11 11:06 ` Pavel Begunkov [this message]
2023-04-11 11:06 ` [PATCH 2/8] io_uring/kbuf: remove extra ->buf_ring null check Pavel Begunkov
2023-04-11 11:06 ` [PATCH 3/8] io_uring: add irq lockdep checks Pavel Begunkov
2023-04-11 11:06 ` [PATCH 4/8] io_uring/rsrc: add " Pavel Begunkov
2023-04-11 11:06 ` [PATCH 5/8] io_uring/rsrc: consolidate node caching Pavel Begunkov
2023-04-11 11:06 ` [PATCH 6/8] io_uring/rsrc: zero node's rsrc data on alloc Pavel Begunkov
2023-04-11 11:06 ` [PATCH 7/8] io_uring/rsrc: refactor io_rsrc_node_switch Pavel Begunkov
2023-04-11 11:06 ` [PATCH 8/8] io_uring/rsrc: extract SCM file put helper Pavel Begunkov
2023-04-12 18:10 ` [PATCH 0/8] for-next cleanups Jens Axboe

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=a6cfbe92c74b789c0b4f046f7f98d19b1ca2e5b7.1681210788.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