nvme: add a sparse annotation to nvme_ns_head_ctrl_ioctl
authorChristoph Hellwig <hch@lst.de>
Wed, 19 May 2021 07:09:56 +0000 (09:09 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 3 Jun 2021 07:29:25 +0000 (10:29 +0300)
Add the __releases annotation to tell sparse that nvme_ns_head_ctrl_ioctl
is expected to unlock head->srcu.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/ioctl.c

index 2c6969ffe85cb9563d879fecc11386be46ce7d0f..2e7780ea0354fc647fb290638625511c87647e3d 100644 (file)
@@ -372,6 +372,7 @@ long nvme_ns_chr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 #ifdef CONFIG_NVME_MULTIPATH
 static int nvme_ns_head_ctrl_ioctl(struct nvme_ns *ns, unsigned int cmd,
                void __user *argp, struct nvme_ns_head *head, int srcu_idx)
+       __releases(&head->srcu)
 {
        struct nvme_ctrl *ctrl = ns->ctrl;
        int ret;