Commit 3a4185be authored by wuzhouhui's avatar wuzhouhui Committed by Jim Harris
Browse files

reduce: check strlen(SPDK_REDUCE_SIGNATURE) in buildtime



Change-Id: I4d12f2a693a4a34c840d972a4f60cbd0fc35011b
Signed-off-by: default avatarwuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/437236


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 7fbc5106
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@
/* Always round up the size of the PM region to the nearest cacheline. */
#define REDUCE_PM_SIZE_ALIGNMENT	64

#define SPDK_REDUCE_SIGNATURE "SPDKREDU"

/* Offset into the backing device where the persistent memory file's path is stored. */
#define REDUCE_BACKING_DEV_PATH_OFFSET	4096

@@ -62,6 +60,11 @@ struct spdk_reduce_vol_superblock {
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_reduce_vol_superblock) == 4096, "size incorrect");

#define SPDK_REDUCE_SIGNATURE "SPDKREDU"
/* null terminator counts one */
SPDK_STATIC_ASSERT(sizeof(SPDK_REDUCE_SIGNATURE) - 1 ==
		   sizeof(((struct spdk_reduce_vol_superblock *)0)->signature), "size incorrect");

#define REDUCE_PATH_MAX 4096

/**