Commit c81fc6c1 authored by Jim Harris's avatar Jim Harris Committed by Changpeng Liu
Browse files

nvme: pad struct spdk_nvme_intel_marketing_description_page



Spec says this should be 512 bytes, but there's a FW bug with
older Fultondale versions that writes 516 bytes instead.

Just pad this out to 4096 bytes to be safe.  There's really
no harm - this structure is barely used.

Fixes issue #780.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I7b4b560845fb40edb4a0ecf4dfa8924ee161ce41

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456880


Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarSeth Howell <seth.howell5141@gmail.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 31607f3f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -202,8 +202,14 @@ SPDK_STATIC_ASSERT(sizeof(union spdk_nvme_intel_feat_latency_tracking) == 4, "In

struct spdk_nvme_intel_marketing_description_page {
	uint8_t		marketing_product[512];
	/* Spec says this log page will only write 512 bytes, but there are some older FW
	 * versions that accidentally write 516 instead.  So just pad this out to 4096 bytes
	 * to make sure users of this structure never end up overwriting unintended parts of
	 * memory.
	 */
	uint8_t		reserved[3584];
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_intel_marketing_description_page) == 512,
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_intel_marketing_description_page) == 4096,
		   "Incorrect size");
#ifdef __cplusplus
}