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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user