From 53bb2cc3bcb014149619dd3de47e0222bf7872e1 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Wed, 16 Jan 2019 15:19:54 +0100 Subject: [PATCH] blobstore: don't ignore bserror If IO fail e.g. during hotremove error shouldn't be ignored as this will trigger operations (like crc checking) that shouldn't be done. Also false error messages are printed. Change-Id: Ie023ddcd9bdba2378e69808302ff9978497c7852 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/c/440889 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Darek Stojaczyk Reviewed-by: Tomasz Zawadzki --- lib/blob/blobstore.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index 7b1e79bc6..a24447feb 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -934,6 +934,15 @@ _spdk_blob_load_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno) int rc; uint32_t crc; + if (bserrno) { + SPDK_ERRLOG("Metadata page read failed: %d\n", bserrno); + _spdk_blob_free(blob); + ctx->cb_fn(seq, NULL, bserrno); + spdk_dma_free(ctx->pages); + free(ctx); + return; + } + page = &ctx->pages[ctx->num_pages - 1]; crc = _spdk_blob_md_page_calc_crc(page); if (crc != page->crc) { @@ -2600,6 +2609,11 @@ _spdk_bs_write_used_md(spdk_bs_sequence_t *seq, void *arg, spdk_bs_sequence_cpl struct spdk_bs_load_ctx *ctx = arg; uint64_t mask_size, lba, lba_count; + if (seq->bserrno) { + _spdk_bs_load_ctx_fail(seq, ctx, seq->bserrno); + return; + } + mask_size = ctx->super->used_page_mask_len * SPDK_BS_PAGE_SIZE; ctx->mask = spdk_dma_zmalloc(mask_size, 0x1000, NULL); if (!ctx->mask) {