nvmet: set status to 0 in case for invalid nsid

[ Upstream commit 40244ad36b ]

For unallocated namespace in nvmet_execute_identify_ns() don't set the
status to NVME_SC_INVALID_NS, set it to zero.

Fixes: bffcd50778 ("nvmet: set right status on error in id-ns handler")
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Chaitanya Kulkarni 2021-02-09 21:47:52 -08:00 committed by Greg Kroah-Hartman
parent 6c32db01dd
commit 0bbbd44ba1

View file

@ -487,7 +487,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)
/* return an all zeroed buffer if we can't find an active namespace */
req->ns = nvmet_find_namespace(ctrl, req->cmd->identify.nsid);
if (!req->ns) {
status = NVME_SC_INVALID_NS;
status = 0;
goto done;
}