From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 013.lax.mailroute.net (013.lax.mailroute.net [199.89.1.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B89862777EA for ; Wed, 25 Mar 2026 21:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774475155; cv=none; b=kX+1FIYrvSNQIAPBdyR11FQgYTZhUlcTZN0QM7b4p8LUG3Fhg069cCr2FHOPm0nMTTNNW7koh/8SO3EH0BhtTbnIaIUHyLB8ha6DwUO56HhdRG/6NWtjvT99ZhNOq77kJT3qqT83BBGCuShITKNkUFtFarnW1nk10fWP5eAbYqI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774475155; c=relaxed/simple; bh=dHObjsFqigg3MqA3xtEWq6yNrbRkoWa6pBI6H2FA2ac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VRUDJH6k9OaJjSGJFZJZs6D41JCq9HOy5IL8a0AWhjR7GwgZcbOWPrPDjnlDtVbNU/kANEz9vvxCiv4GYmzG9iJkTmiJFyA71h7HU1Zhyhn8y6t7v82d3jPc9ucR6HQX3iHFaYNP/uPrAxtgv5ascQXrzDhHqJpHbJxJuE4x/2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=YCM4DLt5; arc=none smtp.client-ip=199.89.1.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="YCM4DLt5" Received: from localhost (localhost [127.0.0.1]) by 013.lax.mailroute.net (Postfix) with ESMTP id 4fh0pB2ZHDzlgy4t; Wed, 25 Mar 2026 21:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1774475149; x=1777067150; bh=RZlmT 9rCmfelVAEMjjiRx+o5faZbQmkLKTTOo/sbXbM=; b=YCM4DLt5ZZGEl3b3+kATv 1SIlgBnDR2TmPmZ42kA+jhqJQeygpMg7SszEtxqLwQ+Z8v67TGQXrlMHRLhFGsRG NBNV4WEjbliBitrakLPngIOnsRzjdCiD//FIZ+PDqWJC/eZv7ahHz0j1CBqN0QqW Pt2oUcZ8+FWnt29ABca1ewz6G22z9afjS879u1EbEkjofYD1jFPYS2gTwdpifehh Ht2lJGfkGx4KIlHbWXmlManRm+aWdXC2UwhEc5S6FzPcQuL5QPj8848VPgPw+vmH I7ktCnmfQT/zgzAa0avRAcxZA0xvM77xcL5cifOaOy0/lyMG2BwbEbGW76IE3J/G Q== X-Virus-Scanned: by MailRoute Received: from 013.lax.mailroute.net ([127.0.0.1]) by localhost (013.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id NmitVVYaX4qQ; Wed, 25 Mar 2026 21:45:49 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.180.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 013.lax.mailroute.net (Postfix) with ESMTPSA id 4fh0p3366WzlfvpM; Wed, 25 Mar 2026 21:45:47 +0000 (UTC) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Damien Le Moal , Tejun Heo , Bart Van Assche , Nathan Chancellor Subject: [PATCH v2 08/26] block/blk-mq-debugfs: Improve lock context annotations Date: Wed, 25 Mar 2026 14:44:49 -0700 Message-ID: <20260325214518.2854494-9-bvanassche@acm.org> X-Mailer: git-send-email 2.53.0.1018.g2bb0e51243-goog In-Reply-To: <20260325214518.2854494-1-bvanassche@acm.org> References: <20260325214518.2854494-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Make the existing lock context annotations compatible with Clang. Add the lock context annotations that are missing. Signed-off-by: Bart Van Assche --- block/blk-mq-debugfs.c | 12 ++++++------ block/blk.h | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 047ec887456b..5c168e82273e 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -20,7 +20,7 @@ static int queue_poll_stat_show(void *data, struct seq_= file *m) } =20 static void *queue_requeue_list_start(struct seq_file *m, loff_t *pos) - __acquires(&q->requeue_lock) + __acquires(&((struct request_queue *)m->private)->requeue_lock) { struct request_queue *q =3D m->private; =20 @@ -36,7 +36,7 @@ static void *queue_requeue_list_next(struct seq_file *m= , void *v, loff_t *pos) } =20 static void queue_requeue_list_stop(struct seq_file *m, void *v) - __releases(&q->requeue_lock) + __releases(&((struct request_queue *)m->private)->requeue_lock) { struct request_queue *q =3D m->private; =20 @@ -298,7 +298,7 @@ int blk_mq_debugfs_rq_show(struct seq_file *m, void *= v) EXPORT_SYMBOL_GPL(blk_mq_debugfs_rq_show); =20 static void *hctx_dispatch_start(struct seq_file *m, loff_t *pos) - __acquires(&hctx->lock) + __acquires(&((struct blk_mq_hw_ctx *)m->private)->lock) { struct blk_mq_hw_ctx *hctx =3D m->private; =20 @@ -314,7 +314,7 @@ static void *hctx_dispatch_next(struct seq_file *m, v= oid *v, loff_t *pos) } =20 static void hctx_dispatch_stop(struct seq_file *m, void *v) - __releases(&hctx->lock) + __releases(&((struct blk_mq_hw_ctx *)m->private)->lock) { struct blk_mq_hw_ctx *hctx =3D m->private; =20 @@ -486,7 +486,7 @@ static int hctx_dispatch_busy_show(void *data, struct= seq_file *m) =20 #define CTX_RQ_SEQ_OPS(name, type) \ static void *ctx_##name##_rq_list_start(struct seq_file *m, loff_t *pos)= \ - __acquires(&ctx->lock) \ + __acquires(&((struct blk_mq_ctx *)m->private)->lock) \ { \ struct blk_mq_ctx *ctx =3D m->private; \ \ @@ -503,7 +503,7 @@ static void *ctx_##name##_rq_list_next(struct seq_fil= e *m, void *v, \ } \ \ static void ctx_##name##_rq_list_stop(struct seq_file *m, void *v) \ - __releases(&ctx->lock) \ + __releases(&((struct blk_mq_ctx *)m->private)->lock) \ { \ struct blk_mq_ctx *ctx =3D m->private; \ \ diff --git a/block/blk.h b/block/blk.h index 103cb1d0b9cb..7082dd5a87f9 100644 --- a/block/blk.h +++ b/block/blk.h @@ -733,16 +733,19 @@ static inline void blk_unfreeze_release_lock(struct= request_queue *q) * reclaim from triggering block I/O. */ static inline void blk_debugfs_lock_nomemsave(struct request_queue *q) + __acquires(&q->debugfs_mutex) { mutex_lock(&q->debugfs_mutex); } =20 static inline void blk_debugfs_unlock_nomemrestore(struct request_queue = *q) + __releases(&q->debugfs_mutex) { mutex_unlock(&q->debugfs_mutex); } =20 static inline unsigned int __must_check blk_debugfs_lock(struct request_= queue *q) + __acquires(&q->debugfs_mutex) { unsigned int memflags =3D memalloc_noio_save(); =20 @@ -752,6 +755,7 @@ static inline unsigned int __must_check blk_debugfs_l= ock(struct request_queue *q =20 static inline void blk_debugfs_unlock(struct request_queue *q, unsigned int memflags) + __releases(&q->debugfs_mutex) { blk_debugfs_unlock_nomemrestore(q); memalloc_noio_restore(memflags);