Re: [PATCHv2 04/17] nvme: add Clang context annotations for nvme_ns_head::requeue_list
From: Nilay Shroff
Date: Fri Jun 26 2026 - 10:29:08 EST
On 6/26/26 12:07 PM, Christoph Hellwig wrote:
Personally, I am also not a big fan of scoped_gurad(...) and friends...diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index a275c03e7c59..9e7f12fe8cd6 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);
- bio_list_init(&head->requeue_list);
- spin_lock_init(&head->requeue_lock);
+ scoped_guard(spinlock_init, &head->requeue_lock)
+ bio_list_init(&head->requeue_list);
We had that discussion before, but this kind of annotation is just
idiotic :(
We really to be able to just initialize fields without annotationsYes this one could be avoided by removing bio_list_init() here.
before they are first published. Now bio_list_init is actually a no-op
on a zero-allocated structure, so we could just drop it here, but this
is a more general problem.
Will update this in next patchset.
Thanks,
--Nilay