linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns
@ 2019-07-29 12:40 Anthony Iliopoulos
  2019-07-29 16:04 ` Sagi Grimberg
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Anthony Iliopoulos @ 2019-07-29 12:40 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
  Cc: Johannes Thumshirn, Anthony Iliopoulos, linux-nvme, linux-kernel

When CONFIG_NVME_MULTIPATH is set, only the hidden gendisk associated
with the per-controller ns is run through revalidate_disk when a
rescan is triggered, while the visible blockdev never gets its size
(bdev->bd_inode->i_size) updated to reflect any capacity changes that
may have occurred.

This prevents online resizing of nvme block devices and in extension of
any filesystems atop that will are unable to expand while mounted, as
userspace relies on the blockdev size for obtaining the disk capacity
(via BLKGETSIZE/64 ioctls).

Fix this by explicitly revalidating the actual namespace gendisk in
addition to the per-controller gendisk, when multipath is enabled.

Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
---
 drivers/nvme/host/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 8f3fbe5ca937..80c7a7ee240b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1715,6 +1715,7 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
 	if (ns->head->disk) {
 		nvme_update_disk_info(ns->head->disk, ns, id);
 		blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
+		revalidate_disk(ns->head->disk);
 	}
 #endif
 }
-- 
2.16.4


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

* Re: [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns
  2019-07-29 12:40 [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns Anthony Iliopoulos
@ 2019-07-29 16:04 ` Sagi Grimberg
  2019-07-30  7:48 ` Johannes Thumshirn
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sagi Grimberg @ 2019-07-29 16:04 UTC (permalink / raw)
  To: Anthony Iliopoulos, Keith Busch, Jens Axboe, Christoph Hellwig
  Cc: Johannes Thumshirn, linux-nvme, linux-kernel

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

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

* Re: [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns
  2019-07-29 12:40 [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns Anthony Iliopoulos
  2019-07-29 16:04 ` Sagi Grimberg
@ 2019-07-30  7:48 ` Johannes Thumshirn
  2019-07-30 10:29 ` Christoph Hellwig
  2019-07-31 12:04 ` Hannes Reinecke
  3 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2019-07-30  7:48 UTC (permalink / raw)
  To: Anthony Iliopoulos
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	linux-kernel, linux-nvme

Thanks Anthony,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
-- 
Johannes Thumshirn                            SUSE Labs Filesystems
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

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

* Re: [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns
  2019-07-29 12:40 [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns Anthony Iliopoulos
  2019-07-29 16:04 ` Sagi Grimberg
  2019-07-30  7:48 ` Johannes Thumshirn
@ 2019-07-30 10:29 ` Christoph Hellwig
  2019-07-31 12:04 ` Hannes Reinecke
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2019-07-30 10:29 UTC (permalink / raw)
  To: Anthony Iliopoulos
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Johannes Thumshirn, linux-nvme, linux-kernel

Thanks,

applied to nvme-5.3.

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

* Re: [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns
  2019-07-29 12:40 [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns Anthony Iliopoulos
                   ` (2 preceding siblings ...)
  2019-07-30 10:29 ` Christoph Hellwig
@ 2019-07-31 12:04 ` Hannes Reinecke
  3 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2019-07-31 12:04 UTC (permalink / raw)
  To: Anthony Iliopoulos, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg
  Cc: linux-kernel, linux-nvme, Johannes Thumshirn

On 7/29/19 2:40 PM, Anthony Iliopoulos wrote:
> When CONFIG_NVME_MULTIPATH is set, only the hidden gendisk associated
> with the per-controller ns is run through revalidate_disk when a
> rescan is triggered, while the visible blockdev never gets its size
> (bdev->bd_inode->i_size) updated to reflect any capacity changes that
> may have occurred.
> 
> This prevents online resizing of nvme block devices and in extension of
> any filesystems atop that will are unable to expand while mounted, as
> userspace relies on the blockdev size for obtaining the disk capacity
> (via BLKGETSIZE/64 ioctls).
> 
> Fix this by explicitly revalidating the actual namespace gendisk in
> addition to the per-controller gendisk, when multipath is enabled.
> 
> Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
> ---
>  drivers/nvme/host/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 8f3fbe5ca937..80c7a7ee240b 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1715,6 +1715,7 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
>  	if (ns->head->disk) {
>  		nvme_update_disk_info(ns->head->disk, ns, id);
>  		blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
> +		revalidate_disk(ns->head->disk);
>  	}
>  #endif
>  }
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)

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

end of thread, other threads:[~2019-07-31 12:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 12:40 [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns Anthony Iliopoulos
2019-07-29 16:04 ` Sagi Grimberg
2019-07-30  7:48 ` Johannes Thumshirn
2019-07-30 10:29 ` Christoph Hellwig
2019-07-31 12:04 ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).