]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: generate AEN for ns revalidate size change
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Tue, 19 May 2020 08:06:28 +0000 (01:06 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 27 May 2020 05:12:38 +0000 (07:12 +0200)
commitbc2960f6c94eea05c6e4cf6ddb01a4b902079ba6
tree4b0c402ceed1c8ea1728da4d2eb472fd4e7f6ab9
parent0e1e77bd5c8d8173a33b5589d060c8b161af0436
nvmet: generate AEN for ns revalidate size change

The newly added function nvmet_ns_revalidate() does update the ns size
in the identify namespace in-core target data structure when host issues
id-ns command. This can lead to host having inconsistencies between size
of the namespace present in the id-ns command result and size of the
corresponding block device until host scans the namespaces explicitly.

To avoid this scenario generate AEN if old size is not same as the new
one in nvmet_ns_revalidate().

This will allow automatic AEN generation when host calls id-ns command
and also allows target to install userspace rules so that it can trigger
nvmet_ns_revalidate() (using configfs interface with the help of next
patch) resulting in appropriate AEN generation when underlying namespace
size change is detected.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Sagi Grimberg <sagi@grimbeg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c