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: Jim Harris <james.r.harris@intel.com>
Change-Id: I0d13e21989b6f43e9f6f16736479395d1d6f0e77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16362
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
Jim Harris 2023-01-19 21:23:48 +00:00 committed by Tomasz Zawadzki
parent b75196ff0a
commit c62637c9e7

View File

@ -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");