diff options
author | Keith Busch <keith.busch@intel.com> | 2015-10-01 17:14:10 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-10-09 10:40:36 -0600 |
commit | 188c3568f814fea965947ed24739987ba9c5a87e (patch) | |
tree | 553e44c9332afce5890e573785ce9887cd01a7ac /include/linux/nvme.h | |
parent | 54ef2b96879334caf8803fdd93b4c556d709d6fd (diff) |
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/linux/nvme.h')
-rw-r--r-- | include/linux/nvme.h | 1 |
1 files changed, 1 insertions, 0 deletions
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; |