All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][linux-block] NVMe: Fix FS mount issue(hot-remove followed by hot-add)
@ 2014-12-11 10:47 Indraneel M
  2014-12-11 15:26 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Indraneel M @ 2014-12-11 10:47 UTC (permalink / raw)


Jens, this version is against the linux-block tree.

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 e2bb8af..a14e90f 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -2600,6 +2600,7 @@ static void nvme_free_dev(struct kref *kref)
 	struct nvme_dev *dev = container_of(kref, struct nvme_dev, kref);
 
 	nvme_free_namespaces(dev);
+	nvme_release_instance(dev);
 	free_percpu(dev->io_queue);
 	kfree(dev->queues);
 	kfree(dev->entry);
@@ -2859,7 +2860,6 @@ static void nvme_remove(struct pci_dev *pdev)
 	nvme_dev_shutdown(dev);
 	nvme_free_queues(dev, 0);
 	rcu_barrier();
-	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] 4+ messages in thread

* [PATCH][linux-block] NVMe: Fix FS mount issue(hot-remove followed by hot-add)
  2014-12-11 10:47 [PATCH][linux-block] NVMe: Fix FS mount issue(hot-remove followed by hot-add) Indraneel M
@ 2014-12-11 15:26 ` Jens Axboe
  2014-12-12  8:47   ` Indraneel Mukherjee
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2014-12-11 15:26 UTC (permalink / raw)


On 12/11/2014 03:47 AM, Indraneel M wrote:
> Jens, this version is against the linux-block tree.

It's not, though:

checking file drivers/block/nvme-core.c
Hunk #1 FAILED at 2600.
Hunk #2 FAILED at 2859.
2 out of 2 hunks FAILED

what branch are you on? It has to be against for-3.19/drivers or 
for-next. This was simple enough to hand apply, so I did that. This is 
the result:

http://git.kernel.dk/?p=linux-block.git;a=commit;h=285dffc9101244ac65c29672a1fb3fe614b52238

-- 
Jens Axboe

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

* [PATCH][linux-block] NVMe: Fix FS mount issue(hot-remove followed by hot-add)
  2014-12-11 15:26 ` Jens Axboe
@ 2014-12-12  8:47   ` Indraneel Mukherjee
  2014-12-12 15:57     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Indraneel Mukherjee @ 2014-12-12  8:47 UTC (permalink / raw)


> -----Original Message-----
> From: Linux-nvme [mailto:linux-nvme-bounces at lists.infradead.org] On Behalf
> Of Jens Axboe
> Sent: Thursday, December 11, 2014 8:56 PM
> To: Indraneel M; linux-nvme at lists.infradead.org; Keith Busch
> Subject: Re: [PATCH][linux-block] NVMe: Fix FS mount issue(hot-remove
> followed by hot-add)
> 
> On 12/11/2014 03:47 AM, Indraneel M wrote:
> > Jens, this version is against the linux-block tree.
> 
> It's not, though:
> 
> checking file drivers/block/nvme-core.c
> Hunk #1 FAILED at 2600.
> Hunk #2 FAILED at 2859.
> 2 out of 2 hunks FAILED
> 
> what branch are you on? It has to be against for-3.19/drivers or for-next.
This
> was simple enough to hand apply, so I did that. This is the result:
> 
> http://git.kernel.dk/?p=linux-
> block.git;a=commit;h=285dffc9101244ac65c29672a1fb3fe614b52238


Thanks Jens! I had just cloned linux-block and created a patch against it
without any branch switch.


> 
> --
> Jens Axboe
> 
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* [PATCH][linux-block] NVMe: Fix FS mount issue(hot-remove followed by hot-add)
  2014-12-12  8:47   ` Indraneel Mukherjee
@ 2014-12-12 15:57     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2014-12-12 15:57 UTC (permalink / raw)


On 12/12/2014 01:47 AM, Indraneel Mukherjee wrote:
>> -----Original Message-----
>> From: Linux-nvme [mailto:linux-nvme-bounces at lists.infradead.org] On Behalf
>> Of Jens Axboe
>> Sent: Thursday, December 11, 2014 8:56 PM
>> To: Indraneel M; linux-nvme at lists.infradead.org; Keith Busch
>> Subject: Re: [PATCH][linux-block] NVMe: Fix FS mount issue(hot-remove
>> followed by hot-add)
>>
>> On 12/11/2014 03:47 AM, Indraneel M wrote:
>>> Jens, this version is against the linux-block tree.
>>
>> It's not, though:
>>
>> checking file drivers/block/nvme-core.c
>> Hunk #1 FAILED at 2600.
>> Hunk #2 FAILED at 2859.
>> 2 out of 2 hunks FAILED
>>
>> what branch are you on? It has to be against for-3.19/drivers or for-next.
> This
>> was simple enough to hand apply, so I did that. This is the result:
>>
>> http://git.kernel.dk/?p=linux-
>> block.git;a=commit;h=285dffc9101244ac65c29672a1fb3fe614b52238
>
>
> Thanks Jens! I had just cloned linux-block and created a patch against it
> without any branch switch.

It's not easy to know... Generally, if we're before a merge window, 
patches should be sent against for-3.x/drivers, where x is the next 
release. If we're after a merge window and it needs to go into this 
version, then patches should be against for-linus (which is generally 
pretty close to master).

-- 
Jens Axboe

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 10:47 [PATCH][linux-block] NVMe: Fix FS mount issue(hot-remove followed by hot-add) Indraneel M
2014-12-11 15:26 ` Jens Axboe
2014-12-12  8:47   ` Indraneel Mukherjee
2014-12-12 15:57     ` 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.