Skip to content

Commit

Permalink
DAOS-16591 mgmt, vos, common: Align scm/meta size
Browse files Browse the repository at this point in the history
Handled meta_sz == 0 during pool extend operation.

Signed-off-by: Sherin T George <sherin-t.george@hpe.com>
  • Loading branch information
sherintg committed Sep 23, 2024
1 parent 35ae67a commit a4bfb57
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/vos/vos_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,15 +784,16 @@ vos_pool_roundup_size(daos_size_t *scm_sz, daos_size_t *meta_sz)
size_t alignsz;
int rc;

D_ASSERT((*scm_sz != 0) && (*meta_sz != 0));
rc = vos_pool_store_type(*scm_sz, *meta_sz);
D_ASSERT(*scm_sz != 0);
rc = vos_pool_store_type(*scm_sz, *meta_sz ? *meta_sz : *scm_sz);
if (rc < 0)
return rc;

/* Round up the size such that it is compatible with backend */
alignsz = umempobj_pgsz(rc);
*scm_sz = max(D_ALIGNUP(*scm_sz, alignsz), 1 << 24);
*meta_sz = max(D_ALIGNUP(*meta_sz, alignsz), 1 << 24);
if (*meta_sz)
*meta_sz = max(D_ALIGNUP(*meta_sz, alignsz), 1 << 24);

return 0;
}
Expand Down

0 comments on commit a4bfb57

Please sign in to comment.