On Tue, Jan 12, 2021 at 01:14:07PM -0800, Chaitanya Kulkarni wrote:
quoted hunk ↗ jump to hunk
@@ -541,7 +543,9 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)
id->nsattr |= (1 << 0);
nvmet_put_namespace(ns);
done:
- status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id));
+ if (nvmet_copy_to_sgl(req, 0, id, sizeof(*id)) && !status)
+ status = NVME_SC_SGL_INVALID_DATA | NVME_SC_DNR;
If the status is already in error, you don't need to copy out the
blank struct, right? Shouldn't this be like:
if (!status)
status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id));
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme