On Sun, Jan 05, 2020 at 09:16:34AM +0000, Roger Leigh wrote: > > Ok, you're right that I haven't done anything wrt 'zfs promote'. Prior to > > switching to zfs, all of my schroot work used the lvm-snapshot type, which > > has the same limitation you describe here: session clones taken while the > > source chroot is in the process of being updated end up cloning some > > intermediate state. I have never had a problem with this limitation in > > practice, since my usage of schroot is entirely human-driven, so it's very > > easy for me to avoid launching new schroots while in the middle of a > > "maintenance window".
> > Being able to update the source atomically certainly seems like a nice > > enhancement, but given that the implementation is currently at parity with > > the lvm-snapshot type, I am not likely to invest effort in this myself at > > this time. > In this case, I think you should copy the btrfs-snapshot approach and make > the source chroot a "directory" chroot type. Then it will operate directly > on the source dataset. That is to say: > sbuild::chroot::ptr > chroot_zfs_snapshot::clone_source () const > { > ptr clone(new chroot_zfs_snapshot(*this)); > > ... > > should be > > chroot_zfs_snapshot::clone_source () const > { > ptr clone(new chroot_directory(*this)); > > chroot_facet_source_clonable::const_ptr psrc > (get_facet<chroot_facet_source_clonable>()); > assert(psrc); > > psrc->clone_source_setup(*this, clone); > > return clone; > } I did look into this as an option, but got tangled up because the source of a zfs clone is not a directory, it's a dataset - which means it is not an absolute filesystem path and is not stat()able. Rather than hacking the directory implementation to relax these constraints and make it compatible with zfs, I decided to keep the zfs implementation self-contained. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer https://www.debian.org/ slanga...@ubuntu.com vor...@debian.org
signature.asc
Description: PGP signature