lib/lvol: lvs_load() shall return, if options are invalid

lvs_load() function verifies if options passed to it
are valid, but doesn't return, if they are not (only error
is logged and callback is called with -EINVAL code). Now
it is corrected and the function ends after the error
is reported.

Change-Id: I19b0b22466b6980345477f62084d27ef13414752
Signed-off-by: Marcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17582
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Marcin Spiewak 2023-04-13 12:06:50 +00:00 committed by David Ko
parent 1ca880e6e9
commit 97a02a9878

View File

@ -422,6 +422,7 @@ lvs_load(struct spdk_bs_dev *bs_dev, const struct spdk_lvs_opts *_lvs_opts,
if (lvs_opts_copy(_lvs_opts, &lvs_opts) != 0) {
SPDK_ERRLOG("Invalid options\n");
cb_fn(cb_arg, NULL, -EINVAL);
return;
}
}