blob_ut: bs_opts initialized with wrong size

An spdk_bs_opts structure is sometimes partially initialized due to
using sizeof(opts) (struct spdk_blob_opts, 64 bytes) rather than
sizeof(bs_opts) (struct spdk_bs_opts, 72 bytes).

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Iaaa89bb419f66969d0888f49f8991c35b3dc5ea4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11268
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Mike Gerdts 2022-01-12 12:14:54 -06:00 committed by Tomasz Zawadzki
parent 9f9c7161c9
commit b66f8df748

View File

@ -3,6 +3,7 @@
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -4915,7 +4916,7 @@ blob_relations(void)
spdk_blob_id ids[10] = {};
dev = init_dev();
spdk_bs_opts_init(&bs_opts, sizeof(opts));
spdk_bs_opts_init(&bs_opts, sizeof(bs_opts));
snprintf(bs_opts.bstype.bstype, sizeof(bs_opts.bstype.bstype), "TESTTYPE");
spdk_bs_init(dev, &bs_opts, bs_op_with_handle_complete, NULL);
@ -5614,7 +5615,7 @@ blob_relations3(void)
spdk_blob_id blobid, snapshotid0, snapshotid1, snapshotid2;
dev = init_dev();
spdk_bs_opts_init(&bs_opts, sizeof(opts));
spdk_bs_opts_init(&bs_opts, sizeof(bs_opts));
snprintf(bs_opts.bstype.bstype, sizeof(bs_opts.bstype.bstype), "TESTTYPE");
spdk_bs_init(dev, &bs_opts, bs_op_with_handle_complete, NULL);