]> git.itanic.dy.fi Git - linux-stable/commit
nvme-multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns
authorAnthony Iliopoulos <ailiopoulos@suse.com>
Mon, 29 Jul 2019 12:40:40 +0000 (14:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:21:54 +0000 (10:21 +0200)
commit7436dc2adeff1c7f018e8b48d049c81a7f4099d6
tree23059f0a2be3280851f5b755dce478a0cb48ec22
parent2013d6ec0bc06868da86e338d01124e5caa3b7a1
nvme-multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns

[ Upstream commit fab7772bfbcfe8fb8e3e352a6a8fcaf044cded17 ]

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>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c