-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Channel programs: add zfs.sync.clone()
#17426
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
Conversation
zfs.sync.clone()
zfs.sync.clone()
Would creating new (empty) filesystems be just as easy? How would mounting the filesystems be handled? Would the channel program be expected to return the list of filesystems to be mounted? |
Would it be possible to also set (non-inheritable) properties on the clone e.g. canmount=noauto? |
@Crest Quick glance says a bit harder, but maybe not very hard, at least for the simple cases.
Unclear to me. I would expect the program itself wouldn't need to do anything; there's already a list of "datasets that were created" on the channel program context that are considered for follow-up work after the fact; this is how device nodes for new zvols are created (this functionality already existed to support zvol snapshots with The tricky part for mounts is that we don't currently have a clean, cross-platform way to set up a mount from inside the kernel. Most of mounting is handled entirely by It would take some actual hard thinking to work out what the right thing to do here is. I won't write it all out, but I have a bunch of questions about permissions, and channel program context, and the calling program, and containers/jails, etc.
I think that's not hard to do. When user properties were added in #9950 it even said that its limited to those because that's all they needed. There might be some that need a little more thought, but constraints like "non-inheritable" and perhaps "no side effects" should be an easy starting point. These are all good avenues for future exploration, not for this PR. Keep banging on about it, and I'll probably get there ;) |
And make its check and sync functions visible, so I can hook them up to zcp_synctask. Rename not strictly necessary, but it definitely looks more like a dsl_dataset thing than a dmu_objset thing, to the extent that those things even have a meaningful distinction. Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes #17426
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes #17426
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes #17426
Motivation and Context
A popular request on the OpenZFS Production Users call is the ability for channel programs to create clones. I was catching up on this week's call at lunch today and heard it again and, in need of a palate cleanser after far too much correctness work this week, I took a swing at it. A pleasant diversion!
Description
Adds
zfs.sync.clone(snapshot, newdataset)
. Since clone is already implemented with a standard check/sync pair of functions, it's all really just wiring.How Has This Been Tested?
New tests included to test the new call, based on the existing
zfs.sync.snapshot()
tests. Since I've renamed and moved things around, I ran thezfs_clone
tests also. All is well!Types of changes
Checklist:
Signed-off-by
.