Skip to content

Conversation

@delan
Copy link
Contributor

@delan delan commented Jan 8, 2026

this patch is still pretty rough, but i have so many questions to ask! see comments marked XXX :)

Motivation and Context

bookmarks support a small set of dataset properties that either reflect the snapshot they were based on (guid, createtxg, creation, ivsetguid) or are unique to the redaction bookmark (redact_snaps, redact_complete).

zfs get <property> can query bookmark properties, but zfs.get_prop() is unable to query bookmark properties (#17949), because doing so for bookmarks requires a different procedure to other datasets.

Description

this patch fixes #17949 by adding a separate code path for bookmarks in zcp_get_prop(), which effectively calls dsl_bookmark_fetch_props() instead of whatever we do for other datasets.

How Has This Been Tested?

(TODO: see issue comments)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the OpenZFS code style requirements.
  • TODO: I have updated the documentation accordingly.
  • I have read the contributing document.
  • TODO: I have added tests to cover my changes.
  • TODO: I have run the ZFS Test Suite with this change applied.
  • TODO: All commit messages are properly formatted and contain Signed-off-by.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jan 8, 2026
@behlendorf behlendorf self-requested a review January 8, 2026 20:41
Comment on lines +935 to +937
// XXX i have no idea why, but the zcp_get_system_prop() path
// stops returning a value (according to lua) if we instead do
// `return (zcp_get_bookmark_prop() || zcp_get_system_prop());`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this was because in C, 0 || 2 is 1, not 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Code Review Needed Ready for review and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zcp: can’t zfs.get_prop() on a bookmark

2 participants