]> www.infradead.org Git - nvme.git/commit
nvmet-passthru: clear EUID/NGUID/UUID while using loop target
authorNilay Shroff <nilay@linux.ibm.com>
Sat, 21 Sep 2024 07:05:33 +0000 (12:35 +0530)
committerKeith Busch <kbusch@kernel.org>
Tue, 1 Oct 2024 18:08:40 +0000 (11:08 -0700)
commite38dad438fc08162e20c600ae899e9e60688f72e
treee5404e65f3e6f03caf278b393e7f223affd98410
parent8be007c8e0911d0450b402ca8cbb1a8cbd00e8f2
nvmet-passthru: clear EUID/NGUID/UUID while using loop target

When nvme passthru is configured using loop target, the clear_ids
attribute is, by default, set to true. This attribute would ensure that
EUID/NGUID/UUID is cleared for the loop passthru target.

The newer NVMe disk supporting the NVMe spec 1.3 or higher, typically,
implements the support for "Namespace Identification Descriptor list"
command. This command when issued from host returns EUID/NGUID/UUID
assigned to the inquired namespace. Not clearing these values, while
using nvme passthru using loop target, would result in NVMe host driver
rejecting the namespace. This check was implemented in the commit
2079f41ec6ff ("nvme: check that EUI/GUID/UUID are globally unique").

The fix implemented in this commit ensure that when host issues ns-id
descriptor list command, the EUID/NGUID/UUID are cleared by passthru
target. In fact, the function nvmet_passthru_override_id_descs() which
clears those unique ids already exits, so we just need to ensure that
ns-id descriptor list command falls through the corretc code path. And
while we're at it, we also combines the three passthru admin command
cases together which shares the same code.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/passthru.c