Skip to content

Commit

Permalink
feat(blobstore): allow setting attributes for snapshots (#34)
Browse files Browse the repository at this point in the history
User can now set xattrs also on snapshots.

Signed-off-by: Mikhail Tcymbaliuk <[email protected]>
  • Loading branch information
mtzaurus authored Jul 25, 2023
1 parent 2a61eeb commit b656160
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/blob/blobstore.c
Original file line number Diff line number Diff line change
Expand Up @@ -7590,8 +7590,8 @@ spdk_blob_sync_md(struct spdk_blob *blob, spdk_blob_op_complete cb_fn, void *cb_

SPDK_DEBUGLOG(blob, "Syncing blob 0x%" PRIx64 "\n", blob->id);

if (blob->md_ro) {
assert(blob->state == SPDK_BLOB_STATE_CLEAN);
/* If no snapshots attributes are modified and no sync needed, bail out fast. */
if (blob->md_ro && blob->state == SPDK_BLOB_STATE_CLEAN) {
cb_fn(cb_arg, 0);
return;
}
Expand Down Expand Up @@ -8021,7 +8021,8 @@ blob_set_xattr(struct spdk_blob *blob, const char *name, const void *value,

blob_verify_md_op(blob);

if (blob->md_ro) {
/* Allow attribute changes on blobs with R/O metadata only for snapshots. */
if (blob->md_ro && bs_get_snapshot_entry(blob->bs, blob->id) == NULL) {
return -EPERM;
}

Expand Down

0 comments on commit b656160

Please sign in to comment.