diff --git a/src/bio/bio_context.c b/src/bio/bio_context.c index 297694c6e6a..e827a9a6f56 100644 --- a/src/bio/bio_context.c +++ b/src/bio/bio_context.c @@ -457,7 +457,8 @@ int bio_mc_destroy(struct bio_xs_context *xs_ctxt, uuid_t pool_id, enum bio_mc_f static int bio_blob_create(uuid_t uuid, struct bio_xs_context *xs_ctxt, uint64_t blob_sz, - enum smd_dev_type st, enum bio_mc_flags flags, spdk_blob_id *blob_id) + enum smd_dev_type st, enum bio_mc_flags flags, spdk_blob_id *blob_id, + uint64_t scm_sz) { struct blob_msg_arg bma = { 0 }; struct blob_cp_arg *ba = &bma.bma_cp_arg; @@ -541,9 +542,10 @@ bio_blob_create(uuid_t uuid, struct bio_xs_context *xs_ctxt, uint64_t blob_sz, blob_sz); else rc = smd_pool_add_tgt(uuid, xs_ctxt->bxc_tgt_id, ba->bca_id, st, - blob_sz); + blob_sz, scm_sz); } else { - rc = smd_pool_add_tgt(uuid, xs_ctxt->bxc_tgt_id, ba->bca_id, st, blob_sz); + rc = smd_pool_add_tgt(uuid, xs_ctxt->bxc_tgt_id, ba->bca_id, st, blob_sz, + 0); } if (rc != 0) { @@ -627,7 +629,7 @@ default_wal_sz(uint64_t meta_sz) return wal_sz; } -int bio_mc_create(struct bio_xs_context *xs_ctxt, uuid_t pool_id, uint64_t meta_sz, +int bio_mc_create(struct bio_xs_context *xs_ctxt, uuid_t pool_id, uint64_t scm_sz, uint64_t meta_sz, uint64_t wal_sz, uint64_t data_sz, enum bio_mc_flags flags) { int rc = 0, rc1; @@ -642,7 +644,7 @@ int bio_mc_create(struct bio_xs_context *xs_ctxt, uuid_t pool_id, uint64_t meta_ if (data_sz > 0 && bio_nvme_configured(SMD_DEV_TYPE_DATA)) { D_ASSERT(!(flags & BIO_MC_FL_RDB)); rc = bio_blob_create(pool_id, xs_ctxt, data_sz, SMD_DEV_TYPE_DATA, flags, - &data_blobid); + &data_blobid, 0); if (rc) return rc; } @@ -656,9 +658,24 @@ int bio_mc_create(struct bio_xs_context *xs_ctxt, uuid_t pool_id, uint64_t meta_ meta_sz, default_cluster_sz()); rc = -DER_INVAL; goto delete_data; + } else if (meta_sz < scm_sz) { + D_ERROR("Meta blob size("DF_U64") is less than scm size("DF_U64")\n", + meta_sz, scm_sz); + rc = -DER_INVAL; + goto delete_data; + } else if (scm_sz == meta_sz) { + scm_sz = 0; + } + + if (scm_sz != 0 && (flags & BIO_MC_FL_RDB)) { + D_ERROR("RDB doesn't allow scm_sz("DF_U64") != meta_sz("DF_U64")\n", + scm_sz, meta_sz); + rc = -DER_INVAL; + goto delete_data; } - rc = bio_blob_create(pool_id, xs_ctxt, meta_sz, SMD_DEV_TYPE_META, flags, &meta_blobid); + rc = bio_blob_create(pool_id, xs_ctxt, meta_sz, SMD_DEV_TYPE_META, flags, &meta_blobid, + scm_sz); if (rc) goto delete_data; @@ -671,7 +688,7 @@ int bio_mc_create(struct bio_xs_context *xs_ctxt, uuid_t pool_id, uint64_t meta_ if (wal_sz == 0 || wal_sz < default_cluster_sz()) wal_sz = default_wal_sz(meta_sz); - rc = bio_blob_create(pool_id, xs_ctxt, wal_sz, SMD_DEV_TYPE_WAL, flags, &wal_blobid); + rc = bio_blob_create(pool_id, xs_ctxt, wal_sz, SMD_DEV_TYPE_WAL, flags, &wal_blobid, 0); if (rc) goto delete_meta; diff --git a/src/bio/smd/smd_internal.h b/src/bio/smd/smd_internal.h index 0b641cddb61..4195581e40a 100644 --- a/src/bio/smd/smd_internal.h +++ b/src/bio/smd/smd_internal.h @@ -27,6 +27,8 @@ extern char TABLE_TGTS[SMD_DEV_TYPE_MAX][SMD_DEV_NAME_MAX]; extern char TABLE_POOLS[SMD_DEV_TYPE_MAX][SMD_DEV_NAME_MAX]; +extern char TABLE_POOLS_EX[SMD_DEV_TYPE_MAX][SMD_DEV_NAME_MAX]; + #define SMD_MAX_TGT_CNT 64 /** callback parameter for smd_db_traverse */ diff --git a/src/bio/smd/smd_pool.c b/src/bio/smd/smd_pool.c index c9d9572c556..41ade489561 100644 --- a/src/bio/smd/smd_pool.c +++ b/src/bio/smd/smd_pool.c @@ -1,5 +1,5 @@ /** - * (C) Copyright 2018-2023 Intel Corporation. + * (C) Copyright 2018-2024 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -35,6 +35,17 @@ struct smd_pool { uint64_t sp_blobs[SMD_MAX_TGT_CNT]; }; +char TABLE_POOLS_EX[SMD_DEV_TYPE_MAX][SMD_DEV_NAME_MAX] = { + "ex_data_pool", + "ex_meta_pool", + "ex_wal_pool", +}; + +struct smd_pool_meta { + uint64_t spm_scm_sz; + uint64_t spm_reserved[3]; +}; + static int smd_pool_find_tgt(struct smd_pool *pool, int tgt_id) { @@ -56,7 +67,6 @@ pool_add_tgt(uuid_t pool_id, uint32_t tgt_id, uint64_t blob_id, char *table_name uuid_copy(id.uuid, pool_id); - smd_db_lock(); /* Fetch pool if it's already existing */ rc = smd_db_fetch(table_name, &id, sizeof(id), &pool, sizeof(pool)); if (rc == 0) { @@ -65,23 +75,20 @@ pool_add_tgt(uuid_t pool_id, uint32_t tgt_id, uint64_t blob_id, char *table_name ""DF_U64" != "DF_U64"\n", DP_UUID(&id.uuid), pool.sp_blob_sz, blob_sz); - rc = -DER_INVAL; - goto out; + return -DER_INVAL; } if (pool.sp_tgt_cnt >= SMD_MAX_TGT_CNT) { D_ERROR("Pool "DF_UUID" is assigned to too many " "targets (%d)\n", DP_UUID(&id.uuid), pool.sp_tgt_cnt); - rc = -DER_OVERFLOW; - goto out; + return -DER_OVERFLOW; } rc = smd_pool_find_tgt(&pool, tgt_id); if (rc >= 0) { D_ERROR("Dup target %d, idx: %d\n", tgt_id, rc); - rc = -DER_EXIST; - goto out; + return -DER_EXIST; } pool.sp_tgts[pool.sp_tgt_cnt] = tgt_id; @@ -102,32 +109,69 @@ pool_add_tgt(uuid_t pool_id, uint32_t tgt_id, uint64_t blob_id, char *table_name } else { D_ERROR("Fetch pool "DF_UUID" failed. "DF_RC"\n", DP_UUID(&id.uuid), DP_RC(rc)); - goto out; + return rc; } rc = smd_db_upsert(table_name, &id, sizeof(id), &pool, sizeof(pool)); - if (rc) { + if (rc) D_ERROR("Update pool "DF_UUID" failed. "DF_RC"\n", DP_UUID(&id.uuid), DP_RC(rc)); - goto out; - } -out: - smd_db_unlock(); + return rc; } int smd_pool_add_tgt(uuid_t pool_id, uint32_t tgt_id, uint64_t blob_id, - enum smd_dev_type st, uint64_t blob_sz) + enum smd_dev_type st, uint64_t blob_sz, uint64_t scm_sz) { - return pool_add_tgt(pool_id, tgt_id, blob_id, TABLE_POOLS[st], blob_sz); + struct smd_pool_meta meta = { 0 }; + struct d_uuid id; + int rc; + + smd_db_lock(); + + rc = pool_add_tgt(pool_id, tgt_id, blob_id, TABLE_POOLS[st], blob_sz); + if (rc || scm_sz == 0) { + smd_db_unlock(); + return rc; + } + + D_ASSERTF(scm_sz < blob_sz, "scm_sz("DF_U64") >= blob_sz("DF_U64")\n", scm_sz, blob_sz); + D_ASSERT(st == SMD_DEV_TYPE_META); + + uuid_copy(id.uuid, pool_id); + /* Fetch pool_meta_ex to see if it's already existing */ + rc = smd_db_fetch(TABLE_POOLS_EX[st], &id, sizeof(id), &meta, sizeof(meta)); + if (rc == 0) { + if (meta.spm_scm_sz != scm_sz) { + D_ERROR("Pool "DF_UUID" meta size mismatch. "DF_U64" != "DF_U64"\n", + DP_UUID(&id.uuid), meta.spm_scm_sz, scm_sz); + rc = -DER_INVAL; + } + } else if (rc == -DER_NONEXIST) { + meta.spm_scm_sz = scm_sz; + rc = smd_db_upsert(TABLE_POOLS_EX[st], &id, sizeof(id), &meta, sizeof(meta)); + if (rc) + DL_ERROR(rc, "Update pool_meta "DF_UUID" failed.", DP_UUID(&id.uuid)); + } else { + DL_ERROR(rc, "Fetch pool_meta "DF_UUID" failed.", DP_UUID(&id.uuid)); + } + + smd_db_unlock(); + return rc; } int smd_rdb_add_tgt(uuid_t pool_id, uint32_t tgt_id, uint64_t blob_id, enum smd_dev_type st, uint64_t blob_sz) { - return pool_add_tgt(pool_id, tgt_id, blob_id, TABLE_RDBS[st], blob_sz); + int rc; + + smd_db_lock(); + rc = pool_add_tgt(pool_id, tgt_id, blob_id, TABLE_RDBS[st], blob_sz); + smd_db_unlock(); + + return rc; } static int @@ -140,20 +184,18 @@ pool_del_tgt(uuid_t pool_id, uint32_t tgt_id, char *table_name) uuid_copy(id.uuid, pool_id); - smd_db_lock(); rc = smd_db_fetch(table_name, &id, sizeof(id), &pool, sizeof(pool)); if (rc) { D_ERROR("Fetch pool "DF_UUID" failed. "DF_RC"\n", DP_UUID(id.uuid), DP_RC(rc)); - goto out; + return rc; } rc = smd_pool_find_tgt(&pool, tgt_id); if (rc < 0) { D_ERROR("Pool "DF_UUID" target %d not found.\n", DP_UUID(id.uuid), tgt_id); - rc = -DER_NONEXIST; - goto out; + return -DER_NONEXIST; } for (i = rc; i < pool.sp_tgt_cnt - 1; i++) { @@ -168,35 +210,60 @@ pool_del_tgt(uuid_t pool_id, uint32_t tgt_id, char *table_name) if (rc) { D_ERROR("Update pool "DF_UUID" failed: "DF_RC"\n", DP_UUID(&id.uuid), DP_RC(rc)); - goto out; + return rc; } } else { rc = smd_db_delete(table_name, &id, sizeof(id)); if (rc) { D_ERROR("Delete pool "DF_UUID" failed: "DF_RC"\n", DP_UUID(&id.uuid), DP_RC(rc)); - goto out; + return rc; } + rc = 1; /* Inform caller that last target is deleted */ } -out: - smd_db_unlock(); + return rc; } int smd_pool_del_tgt(uuid_t pool_id, uint32_t tgt_id, enum smd_dev_type st) { - return pool_del_tgt(pool_id, tgt_id, TABLE_POOLS[st]); + struct d_uuid id; + int rc; + + smd_db_lock(); + rc = pool_del_tgt(pool_id, tgt_id, TABLE_POOLS[st]); + if (rc <= 0) + goto out; + + rc = 0; + if (st == SMD_DEV_TYPE_META) { + uuid_copy(id.uuid, pool_id); + rc = smd_db_delete(TABLE_POOLS_EX[st], &id, sizeof(id)); + if (rc == -DER_NONEXIST) + rc = 0; + else if (rc) + DL_ERROR(rc, "Delete pool_meta "DF_UUID" failed.", DP_UUID(&id.uuid)); + } +out: + smd_db_unlock(); + return rc; } int smd_rdb_del_tgt(uuid_t pool_id, uint32_t tgt_id, enum smd_dev_type st) { - return pool_del_tgt(pool_id, tgt_id, TABLE_RDBS[st]); + int rc; + + smd_db_lock(); + rc = pool_del_tgt(pool_id, tgt_id, TABLE_RDBS[st]); + smd_db_unlock(); + + return rc < 0 ? rc : 0; } static struct smd_pool_info * -smd_pool_alloc_info(struct d_uuid *id, struct smd_pool *pools) +smd_pool_alloc_info(struct d_uuid *id, struct smd_pool *pools, uint64_t scm_sz) { struct smd_pool_info *info; enum smd_dev_type st; @@ -206,6 +273,7 @@ smd_pool_alloc_info(struct d_uuid *id, struct smd_pool *pools) if (info == NULL) return NULL; + info->spi_scm_sz = scm_sz; for (st = SMD_DEV_TYPE_DATA; st < SMD_DEV_TYPE_MAX; st++) { D_ALLOC_ARRAY(info->spi_tgts[st], SMD_MAX_TGT_CNT); if (info->spi_tgts[st] == NULL) { @@ -237,6 +305,7 @@ smd_pool_get_info(uuid_t pool_id, struct smd_pool_info **pool_info) { struct smd_pool_info *info; struct smd_pool pools[SMD_DEV_TYPE_MAX]; + struct smd_pool_meta meta = { 0 }; enum smd_dev_type st; struct d_uuid id; int rc; @@ -255,7 +324,16 @@ smd_pool_get_info(uuid_t pool_id, struct smd_pool_info **pool_info) } } - info = smd_pool_alloc_info(&id, pools); + rc = smd_db_fetch(TABLE_POOLS_EX[SMD_DEV_TYPE_META], &id, sizeof(id), &meta, sizeof(meta)); + if (rc == -DER_NONEXIST) { + meta.spm_scm_sz = pools[SMD_DEV_TYPE_META].sp_blob_sz; + rc = 0; + } else if (rc) { + DL_ERROR(rc, "Fetch pool_meta "DF_UUID" failed.", DP_UUID(&id.uuid)); + goto out; + } + + info = smd_pool_alloc_info(&id, pools, meta.spm_scm_sz); if (info == NULL) { rc = -DER_NOMEM; goto out; @@ -338,6 +416,7 @@ smd_pool_list_cb(struct sys_db *db, char *table, d_iov_t *key, void *args) struct smd_trav_data *td = args; struct smd_pool_info *info; struct smd_pool pools[SMD_DEV_TYPE_MAX]; + struct smd_pool_meta meta = { 0 }; enum smd_dev_type st; struct d_uuid id; int rc; @@ -363,7 +442,16 @@ smd_pool_list_cb(struct sys_db *db, char *table, d_iov_t *key, void *args) return rc; } - info = smd_pool_alloc_info(&id, pools); + rc = smd_db_fetch(TABLE_POOLS_EX[SMD_DEV_TYPE_META], &id, sizeof(id), &meta, sizeof(meta)); + if (rc == -DER_NONEXIST) { + meta.spm_scm_sz = pools[SMD_DEV_TYPE_META].sp_blob_sz; + rc = 0; + } else if (rc) { + DL_ERROR(rc, "Fetch pool_meta "DF_UUID" failed.", DP_UUID(&id.uuid)); + return rc; + } + + info = smd_pool_alloc_info(&id, pools, meta.spm_scm_sz); if (!info) return -DER_NOMEM; diff --git a/src/bio/smd/tests/smd_ut.c b/src/bio/smd/tests/smd_ut.c index 129db9acf0d..bb2fcb6107a 100644 --- a/src/bio/smd/tests/smd_ut.c +++ b/src/bio/smd/tests/smd_ut.c @@ -21,7 +21,7 @@ #include #define SMD_STORAGE_PATH "/mnt/daos" -#define DB_LIST_NR (SMD_DEV_TYPE_MAX * 2 + 1) +#define DB_LIST_NR (SMD_DEV_TYPE_MAX * 2 + 2) struct ut_db { struct sys_db ud_db; @@ -46,11 +46,14 @@ db_name2list(struct sys_db *db, char *name) if (!strcmp(name, TABLE_DEV)) return &ud->ud_lists[0]; + if (!strcmp(name, TABLE_POOLS_EX[SMD_DEV_TYPE_META])) + return &ud->ud_lists[1]; + for (st = SMD_DEV_TYPE_DATA; st < SMD_DEV_TYPE_MAX; st++) { if (!strcmp(name, TABLE_TGTS[st])) - return &ud->ud_lists[st + 1]; + return &ud->ud_lists[st + 2]; if (!strcmp(name, TABLE_POOLS[st])) - return &ud->ud_lists[st + SMD_DEV_TYPE_MAX + 1]; + return &ud->ud_lists[st + SMD_DEV_TYPE_MAX + 2]; } D_ASSERT(0); return NULL; @@ -325,12 +328,13 @@ ut_device(void **state) } static void -verify_pool(struct smd_pool_info *pool_info, uuid_t id, int shift) +verify_pool(struct smd_pool_info *pool_info, uuid_t id, int shift, uint64_t scm_sz) { enum smd_dev_type st; int i, j; assert_int_equal(uuid_compare(pool_info->spi_id, id), 0); + assert_int_equal(pool_info->spi_scm_sz, scm_sz); assert_int_equal(pool_info->spi_tgt_cnt[SMD_DEV_TYPE_DATA], 4); assert_int_equal(pool_info->spi_tgt_cnt[SMD_DEV_TYPE_META], 1); assert_int_equal(pool_info->spi_tgt_cnt[SMD_DEV_TYPE_WAL], 1); @@ -359,35 +363,42 @@ ut_pool(void **state) for (i = 0; i < 6; i++) { st = (i < 4) ? SMD_DEV_TYPE_DATA : SMD_DEV_TYPE_DATA + i - 3; - rc = smd_pool_add_tgt(id1, i, i << 10, st, 100); + rc = smd_pool_add_tgt(id1, i, i << 10, st, 100, 0); assert_rc_equal(rc, 0); - rc = smd_pool_add_tgt(id2, i, i << 20, st, 200); + if (st == SMD_DEV_TYPE_META) + rc = smd_pool_add_tgt(id2, i, i << 20, st, 200, 50); + else + rc = smd_pool_add_tgt(id2, i, i << 20, st, 200, 0); assert_rc_equal(rc, 0); } - rc = smd_pool_add_tgt(id1, 0, 5000, SMD_DEV_TYPE_DATA, 100); + rc = smd_pool_add_tgt(id1, 0, 5000, SMD_DEV_TYPE_DATA, 100, 0); assert_rc_equal(rc, -DER_EXIST); - rc = smd_pool_add_tgt(id1, 4, 4 << 10, SMD_DEV_TYPE_DATA, 200); + rc = smd_pool_add_tgt(id1, 4, 4 << 10, SMD_DEV_TYPE_DATA, 200, 0); assert_rc_equal(rc, -DER_INVAL); - rc = smd_pool_add_tgt(id1, 4, 5000, SMD_DEV_TYPE_META, 100); + rc = smd_pool_add_tgt(id1, 4, 5000, SMD_DEV_TYPE_META, 100, 0); assert_rc_equal(rc, -DER_EXIST); - rc = smd_pool_add_tgt(id1, 0, 4 << 10, SMD_DEV_TYPE_META, 200); + rc = smd_pool_add_tgt(id1, 0, 4 << 10, SMD_DEV_TYPE_META, 200, 0); assert_rc_equal(rc, -DER_INVAL); - rc = smd_pool_add_tgt(id1, 5, 5000, SMD_DEV_TYPE_WAL, 100); + rc = smd_pool_add_tgt(id1, 5, 5000, SMD_DEV_TYPE_WAL, 100, 0); assert_rc_equal(rc, -DER_EXIST); - rc = smd_pool_add_tgt(id1, 0, 4 << 10, SMD_DEV_TYPE_WAL, 200); + rc = smd_pool_add_tgt(id1, 0, 4 << 10, SMD_DEV_TYPE_WAL, 200, 0); assert_rc_equal(rc, -DER_INVAL); rc = smd_pool_get_info(id1, &pool_info); assert_rc_equal(rc, 0); - verify_pool(pool_info, id1, 10); + verify_pool(pool_info, id1, 10, 100); + smd_pool_free_info(pool_info); + rc = smd_pool_get_info(id2, &pool_info); + assert_rc_equal(rc, 0); + verify_pool(pool_info, id2, 20, 50); smd_pool_free_info(pool_info); rc = smd_pool_get_info(id3, &pool_info); @@ -416,9 +427,9 @@ ut_pool(void **state) d_list_for_each_entry_safe(pool_info, tmp, &pool_list, spi_link) { if (uuid_compare(pool_info->spi_id, id1) == 0) - verify_pool(pool_info, id1, 10); + verify_pool(pool_info, id1, 10, 100); else if (uuid_compare(pool_info->spi_id, id2) == 0) - verify_pool(pool_info, id2, 20); + verify_pool(pool_info, id2, 20, 50); else assert_true(false); diff --git a/src/include/daos_srv/bio.h b/src/include/daos_srv/bio.h index 26b15c4aa13..9a18215820c 100644 --- a/src/include/daos_srv/bio.h +++ b/src/include/daos_srv/bio.h @@ -941,6 +941,7 @@ enum bio_mc_flags { * * \param[in] xs_ctxt Per-xstream NVMe context * \param[in] pool_id Pool UUID + * \param[in] scm_sz VOS file size in bytes * \param[in] meta_sz Meta blob size in bytes * \param[in] wal_sz WAL blob in bytes * \param[in] data_sz Data blob in bytes @@ -948,8 +949,8 @@ enum bio_mc_flags { * * \return Zero on success, negative value on error. */ -int bio_mc_create(struct bio_xs_context *xs_ctxt, uuid_t pool_id, uint64_t meta_sz, - uint64_t wal_sz, uint64_t data_sz, enum bio_mc_flags flags); +int bio_mc_create(struct bio_xs_context *xs_ctxt, uuid_t pool_id, uint64_t scm_sz, + uint64_t meta_sz, uint64_t wal_sz, uint64_t data_sz, enum bio_mc_flags flags); /* * Destroy Meta/Data/WAL blobs diff --git a/src/include/daos_srv/smd.h b/src/include/daos_srv/smd.h index 9efc2e790dc..d4de8b7b32b 100644 --- a/src/include/daos_srv/smd.h +++ b/src/include/daos_srv/smd.h @@ -56,6 +56,7 @@ struct smd_dev_info { struct smd_pool_info { d_list_t spi_link; uuid_t spi_id; + uint64_t spi_scm_sz; uint64_t spi_blob_sz[SMD_DEV_TYPE_MAX]; uint16_t spi_flags[SMD_DEV_TYPE_MAX]; uint16_t spi_tgt_cnt[SMD_DEV_TYPE_MAX]; @@ -169,12 +170,13 @@ int smd_dev_replace(uuid_t old_id, uuid_t new_id, unsigned int old_roles); * \param [IN] tgt_id Target ID * \param [IN] blob_id Blob ID * \param [IN] smd_type SMD type - * \param [IN] blob_sz Blob size + * \param [IN] blob_sz Blob size in bytes + * \param [IN] scm_sz VOS file size in bytes * * \return Zero on success, negative value on error */ int smd_pool_add_tgt(uuid_t pool_id, uint32_t tgt_id, uint64_t blob_id, - enum smd_dev_type smd_type, uint64_t blob_sz); + enum smd_dev_type smd_type, uint64_t blob_sz, uint64_t scm_sz); /* Assign a blob to a RDB pool target */ int smd_rdb_add_tgt(uuid_t pool_id, uint32_t tgt_id, uint64_t blob_id, diff --git a/src/mgmt/srv_target.c b/src/mgmt/srv_target.c index 0694d9f9e57..5cbd5da688c 100644 --- a/src/mgmt/srv_target.c +++ b/src/mgmt/srv_target.c @@ -576,7 +576,9 @@ recreate_pooltgts() DP_UUID(pool_info->spi_id), DP_RC(rc)); goto out; } - rc = tgt_recreate(pool_info->spi_id, pool_info->spi_blob_sz[SMD_DEV_TYPE_META], + + D_ASSERT(pool_info->spi_scm_sz > 0); + rc = tgt_recreate(pool_info->spi_id, pool_info->spi_scm_sz, pool_info->spi_tgt_cnt[SMD_DEV_TYPE_META], rdb_blob_sz); if (rc) goto out; diff --git a/src/pool/srv_target.c b/src/pool/srv_target.c index 96a848d9de8..cf94e3f5c70 100644 --- a/src/pool/srv_target.c +++ b/src/pool/srv_target.c @@ -432,7 +432,8 @@ pool_child_recreate(struct ds_pool_child *child) } rc = vos_pool_create(path, child->spc_uuid, 0 /* scm_sz */, - pool_info->spi_blob_sz[SMD_DEV_TYPE_DATA], 0 /* meta_sz */, + pool_info->spi_blob_sz[SMD_DEV_TYPE_DATA], + pool_info->spi_blob_sz[SMD_DEV_TYPE_META], 0 /* flags */, 0 /* version */, NULL); if (rc) DL_ERROR(rc, DF_UUID": Create VOS pool failed.", DP_UUID(child->spc_uuid)); diff --git a/src/utils/ddb/ddb_vos.c b/src/utils/ddb/ddb_vos.c index b331e830fdd..ff52e052247 100644 --- a/src/utils/ddb/ddb_vos.c +++ b/src/utils/ddb/ddb_vos.c @@ -1746,7 +1746,7 @@ sync_cb(struct ddbs_sync_info *info, void *cb_args) D_WARN("delete target failed: " DF_RC "\n", DP_RC(rc)); rc = smd_pool_add_tgt(pool_id, info->dsi_hdr->bbh_vos_id, - info->dsi_hdr->bbh_blob_id, st, blob_size); + info->dsi_hdr->bbh_blob_id, st, blob_size, 0); if (!SUCCESS(rc)) { D_ERROR("add target failed: "DF_RC"\n", DP_RC(rc)); args->sync_rc = rc; diff --git a/src/vos/tests/wal_ut.c b/src/vos/tests/wal_ut.c index 3fd87b5f5ff..64e0277fac5 100644 --- a/src/vos/tests/wal_ut.c +++ b/src/vos/tests/wal_ut.c @@ -29,7 +29,7 @@ ut_mc_init(struct bio_ut_args *args, uint64_t meta_sz, uint64_t wal_sz, uint64_t int rc, ret; uuid_generate(args->bua_pool_id); - rc = bio_mc_create(args->bua_xs_ctxt, args->bua_pool_id, meta_sz, wal_sz, data_sz, 0); + rc = bio_mc_create(args->bua_xs_ctxt, args->bua_pool_id, 0, meta_sz, wal_sz, data_sz, 0); if (rc) { D_ERROR("UT MC create failed. "DF_RC"\n", DP_RC(rc)); return rc; diff --git a/src/vos/vos_pool.c b/src/vos/vos_pool.c index 65b9c0efb09..3f0bdb03707 100644 --- a/src/vos/vos_pool.c +++ b/src/vos/vos_pool.c @@ -780,10 +780,10 @@ vos_pmemobj_create(const char *path, uuid_t pool_id, const char *layout, } D_DEBUG(DB_MGMT, "Create BIO meta context for xs:%p pool:"DF_UUID" " - "meta_sz: %zu, nvme_sz: %zu wal_sz:%zu\n", - xs_ctxt, DP_UUID(pool_id), meta_sz, nvme_sz, wal_sz); + "scm_sz: %zu meta_sz: %zu, nvme_sz: %zu wal_sz:%zu\n", + xs_ctxt, DP_UUID(pool_id), scm_sz, meta_sz, nvme_sz, wal_sz); - rc = bio_mc_create(xs_ctxt, pool_id, meta_sz, wal_sz, nvme_sz, mc_flags); + rc = bio_mc_create(xs_ctxt, pool_id, scm_sz, meta_sz, wal_sz, nvme_sz, mc_flags); if (rc != 0) { D_ERROR("Failed to create BIO meta context for xs:%p pool:"DF_UUID". "DF_RC"\n", xs_ctxt, DP_UUID(pool_id), DP_RC(rc));