From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.219 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796542979; b=zzHfUx1NKI37ATIFCkMlDNM5rU+5qcGDnggdmU0Qm4KSA+1whP1jKsM1SsT3+63Xi9Ps l4NQG75oPcrzk2mscevDPNm5vmdC829aFkPzLV9PAMXS6um3yC8/hCD9XiWifeAHQpeP9 rO6fFmnhslDIUqh1MIpHEddEGxZrZa9ERxPkHJ1/+l9XT7TuA/3sAUbByDV3wj7z3w8n1 2fZCVCqyVqE5mn3Hg3u806ikUJkg4vHQpsvhJs+ThNKMPIAYJnnpRiGaHmwPVC3J2CGdm 9MsUVI7iDudjoKcwimFNCndPVSfXDpJM3+T26qTNA7l4D0RBMbZu3ibtsyFel9SII7A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796542979; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Cc:Subject:To:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=KT97lAMAsdlQHFLchi0fq4Q809rst48Tr+uKvNArzio=; b=wQob7rGqZjvAy8YDq8kSelKMbDZMPmKFfabiHVv+6IxwoOldHPqpdC4yJVNyrSmhy4nx CGgqVPC+yW7z1kl0iEM/8M/oHExj0uBjYMa88FPrnUk68CSCPXKBgtPyos98KrPxkV+UG aZ0OPTkWNj4bBBx3RJzsiQhUHENCa81zT9WME3YjktZcK/cjzsdhwD7jNpQBJI6wBh3y8 vxji5xm7wEvXm04zko9uLciuNqLLMQj/PCaLWn6PXLK1MeKi03lbvF+dpWg7kT8A5GwsB PeUo9R+WddG1mRyjQd/wDwImsM07d4XOtPBabhXSKDWOiAb17Yy2qtCYRv8rR27Nkdw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=UZxw13xD; arc=none smtp.remote-ip=95.215.58.219 Received: from mta1.migadu.com (out-219.mta1.migadu.com [95.215.58.219]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F59A606A31F for ; Sun, 6 Dec 2026 07:42:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0F59A606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=UZxw13xD X-Envelope-To: linux-block@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=VuoTj6yV9LVsvXud6d++mj1AjpU0axyGk3z6F5JVsAM=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796542976; v=1; x=1797147776; b=UZxw13xDYLC8Y4UtrIo+ENbnOm9Vt02ijSOpBOrmaDAYgIoPA1DaqeVyNEPaKnfK21xqA+aK KKJ72EoM6QY0dxUjvposZ8aHaPjNd/qjaoOofitgpNkJ5zBruiEpZyWX/JO+Bv9ateqgN8AX6Gd 0y40HVco4ej4C2H41qSeIgo8= X-Envelope-To: linux-block@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id a13452f9cf440bb4; Sun, 06 Dec 2026 07:42:55 +0000 X-Mizu-Trace-ID: a13452f9cf440bb4 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Sun, 6 Dec 2026 15:42:51 +0800 X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: cui.tao@linux.dev, linux-block@vger.kernel.org, Christoph Hellwig , Damien Le Moal Subject: Re: [PATCH 0/4] Fix sparse warnings in the block layer To: Bart Van Assche , Jens Axboe References: From: Tao Cui In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tao Cui 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(-)