aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/admin-cmd.c
diff options
context:
space:
mode:
authorAnthony Iliopoulos <ailiop@suse.com>2020-04-19 16:48:50 -0700
committerJens Axboe <axboe@kernel.dk>2020-05-09 16:18:35 -0600
commite8cd1ff11d58a21242ea2b85450298f3681768a1 (patch)
tree70ad6f52105d290ddd8e53cf4d65de65f93f6ee5 /drivers/nvme/target/admin-cmd.c
parentnvme: consolodate io settings (diff)
downloadlinux-dev-e8cd1ff11d58a21242ea2b85450298f3681768a1.tar.xz
linux-dev-e8cd1ff11d58a21242ea2b85450298f3681768a1.zip
nvmet: add ns revalidation support
Add support for detecting capacity changes on nvmet blockdev and file backed namespaces. This allows for emulating and testing online resizing of nvme devices and filesystems on top. Signed-off-by: Anthony Iliopoulos <ailiop@suse.com> [chaitanya: Fix comments posted on V1] Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> [hch: reuse code a bit more] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/target/admin-cmd.c')
-rw-r--r--drivers/nvme/target/admin-cmd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index 9d6f75cfa77c..4c79aa804887 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -486,6 +486,11 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)
if (!ns)
goto done;
+ if (ns->bdev)
+ nvmet_bdev_ns_revalidate(ns);
+ else
+ nvmet_file_ns_revalidate(ns);
+
/*
* nuse = ncap = nsze isn't always true, but we have no way to find
* that out from the underlying device.