[PATCH v2 13/22] nvmet: add context annotation for nvmet_ns::enabled
Nilay Shroff
nilay at linux.ibm.com
Tue Nov 17 23:34:54 PST 2026
The nvmet_ns::enabled field is protected by nvmet_subsys::lock.
Annotate it with __guarded_by(&subsys->lock) so that the clang
context analyzer can validate accesses to this field.
Signed-off-by: Nilay Shroff <nilay at linux.ibm.com>
---
drivers/nvme/target/nvmet.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index 5e9bfec2d384..6a1c27cc08e5 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -170,7 +170,8 @@ struct nvmet_ns {
bool buffered_io
__guarded_by(&subsys->lock);
- bool enabled;
+ bool enabled
+ __guarded_by(&subsys->lock);
#define NVMET_NS_IO_LIVE 0
unsigned long flags;
struct nvmet_subsys *subsys;
--
2.53.0
More information about the Linux-nvme
mailing list