Skip to content

Commit

Permalink
blobstore: error code for out-of-metadata condition
Browse files Browse the repository at this point in the history
Previously, when a blob store ran out of free metadata page during
volume creation, an ambigious ENOMEM error was returned.
Now, in order to allow to have meaningful client-faced error message and codes,
EMFILE is returned instead.

Signed-off-by: Dmitry Savitskiy <[email protected]>
  • Loading branch information
dsavitskiy committed May 9, 2024
1 parent 6bc564c commit 5e0b422
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/blob/blobstore.c
Original file line number Diff line number Diff line change
Expand Up @@ -6255,10 +6255,12 @@ bs_create_blob(struct spdk_blob_store *bs,
spdk_spin_lock(&bs->used_lock);
page_idx = spdk_bit_array_find_first_clear(bs->used_md_pages, 0);
if (page_idx == UINT32_MAX) {
SPDK_ERRLOG("Failed to allocate metadata for a new blob\n");
spdk_spin_unlock(&bs->used_lock);
cb_fn(cb_arg, 0, -ENOMEM);
cb_fn(cb_arg, 0, -EMFILE);
return;
}

spdk_bit_array_set(bs->used_blobids, page_idx);
bs_claim_md_page(bs, page_idx);
spdk_spin_unlock(&bs->used_lock);
Expand Down

0 comments on commit 5e0b422

Please sign in to comment.