All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NVMe: Fix FS mount issue (hot-remove followed by hot-add)
@ 2014-12-10 14:25 Indraneel M
  2014-12-10 20:00 ` Keith Busch
  0 siblings, 1 reply; 3+ messages in thread
From: Indraneel M @ 2014-12-10 14:25 UTC (permalink / raw)


After Hot-remove of a device with a mounted partition,
when the device is hot-added again, the new node reappears
as nvme0n1. Mounting this new node fails with the error:

mount: mount /dev/nvme0n1p1 on /mnt failed: File exists.

The old nodes's FS entries still exist and the kernel can't re-create
procfs and sysfs entries for the new node with the same name.
The patch fixes this issue.

Signed-off-by: Indraneel M <indraneel.m at samsung.com>

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 00fa5d2..5c151d7 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -2735,6 +2735,7 @@ static void nvme_free_dev(struct kref *kref)
 
 	pci_dev_put(dev->pci_dev);
 	nvme_free_namespaces(dev);
+	nvme_release_instance(dev);
 	free_percpu(dev->io_queue);
 	kfree(dev->queues);
 	kfree(dev->entry);
@@ -2995,7 +2996,6 @@ static void nvme_remove(struct pci_dev *pdev)
 	nvme_dev_shutdown(dev);
 	nvme_free_queues(dev, 0);
 	nvme_dev_remove(dev);
-	nvme_release_instance(dev);
 	nvme_release_prp_pools(dev);
 	kref_put(&dev->kref, nvme_free_dev);
 }
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] NVMe: Fix FS mount issue (hot-remove followed by hot-add)
  2014-12-10 14:25 [PATCH] NVMe: Fix FS mount issue (hot-remove followed by hot-add) Indraneel M
@ 2014-12-10 20:00 ` Keith Busch
  2014-12-11 15:20   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Busch @ 2014-12-10 20:00 UTC (permalink / raw)


On Wed, 10 Dec 2014, Indraneel M wrote:
> After Hot-remove of a device with a mounted partition,
> when the device is hot-added again, the new node reappears
> as nvme0n1. Mounting this new node fails with the error:
>
> mount: mount /dev/nvme0n1p1 on /mnt failed: File exists.
>
> The old nodes's FS entries still exist and the kernel can't re-create
> procfs and sysfs entries for the new node with the same name.
> The patch fixes this issue.
>
> Signed-off-by: Indraneel M <indraneel.m at samsung.com>

Acked-by: Keith Busch <keith.busch at intel.com>

Now where is this going? It won't apply to linux-block/for-next (though
it is a trivial manual merge), which I think is where the 3.19 pull
request to mainline will come from. I hope these trees get synced up
soon so we don't have these fragmented drivers.

> diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
> index 00fa5d2..5c151d7 100644
> --- a/drivers/block/nvme-core.c
> +++ b/drivers/block/nvme-core.c
> @@ -2735,6 +2735,7 @@ static void nvme_free_dev(struct kref *kref)
>
> 	pci_dev_put(dev->pci_dev);
> 	nvme_free_namespaces(dev);
> +	nvme_release_instance(dev);
> 	free_percpu(dev->io_queue);
> 	kfree(dev->queues);
> 	kfree(dev->entry);
> @@ -2995,7 +2996,6 @@ static void nvme_remove(struct pci_dev *pdev)
> 	nvme_dev_shutdown(dev);
> 	nvme_free_queues(dev, 0);
> 	nvme_dev_remove(dev);
> -	nvme_release_instance(dev);
> 	nvme_release_prp_pools(dev);
> 	kref_put(&dev->kref, nvme_free_dev);
> }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] NVMe: Fix FS mount issue (hot-remove followed by hot-add)
  2014-12-10 20:00 ` Keith Busch
@ 2014-12-11 15:20   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2014-12-11 15:20 UTC (permalink / raw)


On 12/10/2014 01:00 PM, Keith Busch wrote:
> On Wed, 10 Dec 2014, Indraneel M wrote:
>> After Hot-remove of a device with a mounted partition,
>> when the device is hot-added again, the new node reappears
>> as nvme0n1. Mounting this new node fails with the error:
>>
>> mount: mount /dev/nvme0n1p1 on /mnt failed: File exists.
>>
>> The old nodes's FS entries still exist and the kernel can't re-create
>> procfs and sysfs entries for the new node with the same name.
>> The patch fixes this issue.
>>
>> Signed-off-by: Indraneel M <indraneel.m at samsung.com>
>
> Acked-by: Keith Busch <keith.busch at intel.com>
>
> Now where is this going? It won't apply to linux-block/for-next (though
> it is a trivial manual merge), which I think is where the 3.19 pull
> request to mainline will come from. I hope these trees get synced up
> soon so we don't have these fragmented drivers.

He sent a for-3.19/drivers relevant patch too - I'll add your acked by 
and queue that up.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-11 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10 14:25 [PATCH] NVMe: Fix FS mount issue (hot-remove followed by hot-add) Indraneel M
2014-12-10 20:00 ` Keith Busch
2014-12-11 15:20   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.