From: Keith Busch Date: Fri, 3 Oct 2014 17:15:47 +0000 (-0600) Subject: NVMe: Do not open disks that are being deleted X-Git-Tag: omap-for-v3.19/fixes-rc1~94^2~33 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e60352cf83faaba57f99f6960b545687b8bbb20;p=pandora-kernel.git NVMe: Do not open disks that are being deleted It is possible the block layer will request to open a block device after the driver deleted it. Subsequent releases will cause a double free, or the disk's private_data is pointing to freed memory. This patch protects the driver's freed disks from being opened and accessed: the nvme namespaces are freed only when the device's refcount is 0, so at that moment there were no active openers and no more should be allowed, and it is safe to clear the disk's private_data that is about to be freed. Signed-off-by: Keith Busch Reported-by: Henry Chow Signed-off-by: Matthew Wilcox Signed-off-by: Jens Axboe --- Reading git-diff-tree failed