From e739a50f48d16ddb2babcee4644e3ef94ee66d61 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 19 Oct 2017 08:36:25 -0700 Subject: [PATCH] blob: initialize super_blob and bstype during load A recent patch did some refactoring on how the superblock is written out - it introduced a bug where on load we would write out INVALID for super_blob id and a null bstype when clearing the clean bit. Signed-off-by: Jim Harris Change-Id: I1d6256e35030645b3e8fda83bfe0f74aeb635733 Reviewed-on: https://review.gerrithub.io/383129 Reviewed-by: Maciej Szwed Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp --- lib/blob/blobstore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index 92b3aa5da..535b38642 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -1728,6 +1728,8 @@ _spdk_bs_load_super_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno) return; } + ctx->bs->super_blob = ctx->super->super_blob; + memcpy(&ctx->bs->bstype, &ctx->super->bstype, sizeof(ctx->super->bstype)); ctx->super->clean = 0; _spdk_bs_write_super(seq, ctx->bs, ctx->super, _spdk_bs_load_write_super_cpl, ctx); }