Commit c62637c9 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

perf: zero the ns_entry buffer for aio/uring



Otherwise we get garbage in ns_entry->zipf.  If
this is not-NULL, we use it for zipf random
distribution and segfault since it's not-NULL but
also not valid.

So use calloc instead.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I0d13e21989b6f43e9f6f16736479395d1d6f0e77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16362


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent b75196ff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -725,7 +725,7 @@ register_file(const char *path)
		g_io_align = blklen;
	}

	entry = malloc(sizeof(struct ns_entry));
	entry = calloc(1, sizeof(struct ns_entry));
	if (entry == NULL) {
		close(fd);
		perror("ns_entry malloc");