From 188c3568f814fea965947ed24739987ba9c5a87e Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Thu, 1 Oct 2015 17:14:10 -0600 Subject: NVMe: Reference count open namespaces Dynamic namespace attachment means the namespace may be removed at any time, so the namespace reference count can not be tied to the device reference count. This fixes a NULL dereference if an opened namespace is detached from a controller. Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- include/linux/nvme.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/nvme.h b/include/linux/nvme.h index b5812c395351..992b9c118678 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -135,6 +135,7 @@ struct nvme_ns { struct nvme_dev *dev; struct request_queue *queue; struct gendisk *disk; + struct kref kref; unsigned ns_id; int lba_shift; -- cgit v1.2.3