From 712ab983dfb071909050ae81739ad8a94e60cd3f Mon Sep 17 00:00:00 2001 From: Mike Gerdts Date: Wed, 22 Mar 2023 23:55:38 -0500 Subject: [PATCH] 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 Change-Id: I6d756da47f41fb554cd6782add63378e81735118 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17292 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/blob/blobstore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index f59852353..00d122543 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -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; }