summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2015-10-01 17:14:10 -0600
committerJens Axboe <axboe@fb.com>2015-10-09 10:40:36 -0600
commit188c3568f814fea965947ed24739987ba9c5a87e (patch)
tree553e44c9332afce5890e573785ce9887cd01a7ac /include
parent54ef2b96879334caf8803fdd93b4c556d709d6fd (diff)
downloadlinux-0-day-188c3568f814fea965947ed24739987ba9c5a87e.tar.gz
linux-0-day-188c3568f814fea965947ed24739987ba9c5a87e.tar.xz
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 <keith.busch@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nvme.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index b5812c395351a..992b9c1186788 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;