nvmet: return uniform error for invalid ns
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Wed, 10 Feb 2021 05:47:53 +0000 (21:47 -0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 10 Feb 2021 15:38:04 +0000 (16:38 +0100)
commitaa0aff604a60627b9f6c51c99dd5f63634322668
tree2f0a3b7f36c827d63fc8f2e12aa3333808a0fb28
parent40244ad36bcfb796a6bb9e95bdcbf8ddf3134509
nvmet: return uniform error for invalid ns

For nvmet_find_namespace() error case we have inconsistent error code
mapping in the function nvmet_get_smart_log_nsid() and
nvmet_set_feat_write_protect().

There is no point in retrying for the invalid namesapce from the host
side. Set the error code to the NVME_SC_INVALID_NS | NVME_SC_DNR which
matches what we have in nvmet_execute_identify_desclist().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/admin-cmd.c