Re: [PATCH 04/15] nvme: add Clang context annotations for nvme_ns_head::requeue_list
From: Nilay Shroff
Date: Thu Jun 11 2026 - 00:18:39 EST
On 6/10/26 9:55 PM, Bart Van Assche wrote:
On 6/10/26 7:27 AM, Nilay Shroff wrote:Yes makes sense, I'll replace guard() with scoped_guard().
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.cscoped_guard() is preferred over guard() because with scoped_guard() the
index a275c03e7c59..985a8c693c6f 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -706,8 +706,8 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
struct queue_limits lim;
mutex_init(&head->lock);
+ guard(spinlock_init)(&head->requeue_lock);
bio_list_init(&head->requeue_list);
- spin_lock_init(&head->requeue_lock);
scope the guard applies to is explicit. When using guard(), if new code
is added, it may end up being covered by a guard() statement although it
shouldn't.
Thanks,
--Nilay