From 75be891e5a0cd8bc91998fdf36ee5107cbe55c33 Mon Sep 17 00:00:00 2001 From: Abhilash Shetty Date: Mon, 20 Apr 2026 09:19:59 +0000 Subject: [PATCH] fix(blobstore): consider default page size if its zero If the metadata page size is not set, then it means that the blobstore was created with an older version of SPDK. In that case, we can assume that the page size is equal to SPDK_BS_PAGE_SIZE, since that's what it was in older versions Signed-off-by: Abhilash Shetty --- lib/blob/blobstore.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index 7ce57ffa34f..c0c9c88988f 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -10306,6 +10306,13 @@ bs_grow_live_load_super_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno) dev_size = ctx->bs->dev->blockcnt * ctx->bs->dev->blocklen; total_clusters = dev_size / ctx->super->cluster_size; + /* + * If the metadata page size is not set, then it means that the blobstore was created with an older version of SPDK. + * In that case, we can assume that the page size is equal to SPDK_BS_PAGE_SIZE, since that's what it was in older versions. + */ + if (ctx->super->md_page_size == 0) { + ctx->super->md_page_size = SPDK_BS_PAGE_SIZE; + } used_cluster_mask_len = spdk_divide_round_up(sizeof(struct spdk_bs_md_mask) + spdk_divide_round_up(total_clusters, 8), ctx->super->md_page_size);