From: Tao Cui <cui.tao@linux.dev>
To: Bart Van Assche <bvanassche@acm.org>, Jens Axboe <axboe@kernel.dk>
Cc: cui.tao@linux.dev, linux-block@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
Damien Le Moal <dlemoal@kernel.org>
Subject: Re: [PATCH 0/4] Fix sparse warnings in the block layer
Date: Sun, 6 Dec 2026 15:42:51 +0800 [thread overview]
Message-ID: <b3a0aaec-0cd7-45aa-a18a-811125c50f18@linux.dev> (raw)
In-Reply-To: <cover.1796422079.git.bvanassche@acm.org>
Hello, Bart,
在 2026/12/5 6:10, Bart Van Assche 写道:
> Hi Jens,
>
> This patch series fixes sparse warnings in the block layer core, in
> blk-mq and in the block tracepoints. These warnings are caused by the
> __bitwise annotations of blk_opf_t and blk_mq_req_flags_t and by the
> __rcu annotation of struct request_queue::queue_hw_ctx. The warnings
> fixed by patch 1/4 are only reported by sparse after a pending sparse
> change has been merged (I plan to merge that sparse change soon). These
> patches do not modify the code generated for x86-64 systems. Please
> consider this patch series for the next merge window.
>
Applied the series on next-20261204 and built for x86-64 with gcc 12.3.1.
With sparse 0.6.4 all seven warnings this series fixes are gone and no new
ones show up in blk-core.c, blk-mq.c or blk-mq-tag.c. A full build passes,
and the text sections of blk-core.o, blk-mq.o and blk-mq-tag.o are
byte-identical before and after, which matches the codegen claim in the
cover letter.
A few small things. block/blk.h:346 still warns about try_cmpxchg()
passing a pointer to a restricted req_flags_t, but that's pre-existing and
outside this series. In 3/4 the assignment "__entry->is_reserved =
alloc_flags & BLK_MQ_REQ_RESERVED;" in TP_fast_assign still narrows a
restricted value into a bool; current sparse is fine with it, but if your
pending sparse change starts checking assignments that line may warn.
Also wondering if 4/4 should carry Fixes: 89e1fb7ceffd, since that's what
annotated queue_hw_ctx with __rcu.
Other than that, no issues from my side.
Tested-by: Tao Cui <cuitao@kylinos.cn>
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
Thanks,
Tao
> Thanks,
>
> Bart.
>
> Bart Van Assche (4):
> block: Fix sparse warnings in blk_op_str()
> block: Fix a sparse warning in str_to_blk_op()
> blk-mq: Fix sparse warnings in block_rq_tag_wait
> blk-mq: Use RCU helpers when accessing q->queue_hw_ctx
>
> block/blk-core.c | 7 ++++---
> block/blk-mq.c | 22 ++++++++++++++++++----
> include/trace/events/block.h | 2 +-
> 3 files changed, 23 insertions(+), 8 deletions(-)
prev parent reply other threads:[~2026-12-06 7:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 22:10 [PATCH 0/4] Fix sparse warnings in the block layer Bart Van Assche
2026-12-04 22:10 ` [PATCH 1/4] block: Fix sparse warnings in blk_op_str() Bart Van Assche
2026-12-04 22:11 ` [PATCH 2/4] block: Fix a sparse warning in str_to_blk_op() Bart Van Assche
2026-12-04 22:11 ` [PATCH 3/4] blk-mq: Fix sparse warnings in block_rq_tag_wait Bart Van Assche
2026-12-04 22:11 ` [PATCH 4/4] blk-mq: Use RCU helpers when accessing q->queue_hw_ctx Bart Van Assche
2026-12-06 7:42 ` Tao Cui [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=b3a0aaec-0cd7-45aa-a18a-811125c50f18@linux.dev \
--to=cui.tao@linux.dev \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=dlemoal@kernel.org \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
/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