Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/zfs: support creating parents with canmount=no #17000

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

intelfx
Copy link

@intelfx intelfx commented Jan 28, 2025

Motivation and Context

Sometimes (depending on the dataset organization practice chosen by the admin),
a pool will make heavy use of empty datasets with canmount=no that are used
strictly to group other contained datasets and/or inherit properties such as
mountpoint. This organization practice is referenced in zfsprops(7).

Under these conditions, using zfs create -p (and other commands with -p)
is very inconvenient because the parent datasets will be created with the
default value of canmount (which is non-inheritable).

Description

This branch adds an optional mode to zfs create, zfs rename and zfs clone
subcommands that requests ZFS to create parent datasets with canmount=no.

For now, this mode is invoked via a double -p option (e.g., zfs create -pp)
because I don't have a better idea. Suggestions welcome.

How Has This Been Tested?

  • manually tested on x86_64 Linux

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)
  • 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:

This will be used to support creating non-mountable ancestors in zfs(8).

Signed-off-by: Ivan Shapovalov <[email protected]>
Teach `zfs {create,clone,rename}` to accept a doubled `-p` flag (`-pp`)
to create non-existing ancestor datasets with `canmount=off`.

Signed-off-by: Ivan Shapovalov <[email protected]>
@github-actions github-actions bot added the Status: Work in Progress Not yet ready for general review label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Work in Progress Not yet ready for general review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant