blob: set rc to -EINVAL when esnap len too long

When bs_create_blob() is creating the internal xattr for the esnap ID,
it errors out if the ID is too long. This error path neglected to set
the return value. It now returns -EINVAL in this case.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I6d756da47f41fb554cd6782add63378e81735118
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17292
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Mike Gerdts 2023-03-22 23:55:38 -05:00 committed by Ben Walker
parent 6a55d0dbfa
commit 712ab983df

View File

@ -6029,6 +6029,7 @@ bs_create_blob(struct spdk_blob_store *bs,
if (opts_local.esnap_id_len > UINT16_MAX) {
SPDK_ERRLOG("esnap id length %" PRIu64 "is too long\n",
opts_local.esnap_id_len);
rc = -EINVAL;
goto error;
}