lib/blob: only validate blobid of first page during bs_load
Blob id only is matched to the very first page of md for that particular blob. During loading blobstore, we shouldn't verify further pages in chain against the blobid. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: Ifc7863ddcb403aedc264c14e6b4c3915bd30dc41 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460607 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
parent
5e74b8e653
commit
6ced601526
@ -3073,7 +3073,8 @@ static bool _spdk_bs_load_cur_md_page_valid(struct spdk_bs_load_ctx *ctx)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_spdk_bs_page_to_blobid(ctx->cur_page) != ctx->page->id) {
|
if (ctx->page->sequence_num == 0 &&
|
||||||
|
_spdk_bs_page_to_blobid(ctx->cur_page) != ctx->page->id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -3664,6 +3664,19 @@ blob_dirty_shutdown(void)
|
|||||||
rc = spdk_blob_set_xattr(blob, "length", &length, sizeof(length));
|
rc = spdk_blob_set_xattr(blob, "length", &length, sizeof(length));
|
||||||
CU_ASSERT(rc == 0);
|
CU_ASSERT(rc == 0);
|
||||||
|
|
||||||
|
/* Put xattr that fits exactly single page.
|
||||||
|
* This results in adding additional pages to MD.
|
||||||
|
* First is flags and smaller xattr, second the large xattr,
|
||||||
|
* third are just the extents.
|
||||||
|
*/
|
||||||
|
size_t xattr_length = 4072 - sizeof(struct spdk_blob_md_descriptor_xattr) -
|
||||||
|
strlen("large_xattr");
|
||||||
|
char *xattr = calloc(xattr_length, sizeof(char));
|
||||||
|
SPDK_CU_ASSERT_FATAL(xattr != NULL);
|
||||||
|
rc = spdk_blob_set_xattr(blob, "large_xattr", xattr, xattr_length);
|
||||||
|
free(xattr);
|
||||||
|
SPDK_CU_ASSERT_FATAL(rc == 0);
|
||||||
|
|
||||||
/* Resize the blob */
|
/* Resize the blob */
|
||||||
spdk_blob_resize(blob, 10, blob_op_complete, NULL);
|
spdk_blob_resize(blob, 10, blob_op_complete, NULL);
|
||||||
poll_threads();
|
poll_threads();
|
||||||
|
Loading…
Reference in New Issue
Block a user