nvmf: Don't fail a property set command with invalid bits

If the initiator sends a property set command to a valid register, but
the value contains bits that are reserved by the NVMe specification,
don't fail the whole command. Just log an error message.

Previously, any valid bits set would take effect but then the command
would also fail. That confuses the initiator and thinks it must retry
the full property set.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I566bc68c4469b9f41c69902e276f825c86683075
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4814
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Ben Walker 2020-10-21 12:56:23 -07:00 committed by Tomasz Zawadzki
parent 6eca984a77
commit 2ec88c4f8c

View File

@ -950,8 +950,10 @@ nvmf_prop_set_cc(struct spdk_nvmf_ctrlr *ctrlr, uint32_t value)
}
if (diff.raw != 0) {
/* Print an error message, but don't fail the command in this case.
* If we did want to fail in this case, we'd need to ensure we acted
* on no other bits or the initiator gets confused. */
SPDK_ERRLOG("Prop Set CC toggled reserved bits 0x%x!\n", diff.raw);
return false;
}
return true;