[lxc-devel] [PATCH] Track snapshot dependencies (v2)

2013-08-21 Thread Serge Hallyn
(Will push in a bit barring any objections) lvm, btrfs, and zfs snapshots each do an ok job of handling deletions for us - a btrfs snapshot does fine after the original is removed, while zfs and lvm will both refuse to allow the original to be deleted while the snapshot exists. Overlayfs doesn't

Re: [lxc-devel] [PATCH] Track snapshot dependencies

2013-08-21 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > Ahh yeah, thats probably a good idea. They can also get off if people > just rm -rf the container (and I'm guilty of doing that sometimes), so > like you said "best effort". Drat, that would require an API change to pass a flag to destroy. Still mi

Re: [lxc-devel] [PATCH] Track snapshot dependencies

2013-08-21 Thread Dwight Engen
On Wed, 21 Aug 2013 12:18:13 -0500 Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): > > On Wed, 21 Aug 2013 10:47:20 -0500 > > Serge Hallyn wrote: > > > > > Quoting Dwight Engen (dwight.en...@oracle.com): > > > > On Tue, 20 Aug 2013 14:15:26 -0500 > > > > Serge Hallyn wrot

Re: [lxc-devel] [PATCH] Track snapshot dependencies

2013-08-21 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > On Wed, 21 Aug 2013 10:47:20 -0500 > Serge Hallyn wrote: > > > Quoting Dwight Engen (dwight.en...@oracle.com): > > > On Tue, 20 Aug 2013 14:15:26 -0500 > > > Serge Hallyn wrote: > > > > > > [...] > > > > +static bool mod_rdep(struct lxc_containe

Re: [lxc-devel] [PATCH] Track snapshot dependencies

2013-08-21 Thread Dwight Engen
On Wed, 21 Aug 2013 10:47:20 -0500 Serge Hallyn wrote: > Quoting Dwight Engen (dwight.en...@oracle.com): > > On Tue, 20 Aug 2013 14:15:26 -0500 > > Serge Hallyn wrote: > > > > [...] > > > +static bool mod_rdep(struct lxc_container *c, bool inc) > > > +{ > > > + char path[MAXPATHLEN]; > > > + in

Re: [lxc-devel] [PATCH] Track snapshot dependencies

2013-08-21 Thread Serge Hallyn
Quoting Dwight Engen (dwight.en...@oracle.com): > On Tue, 20 Aug 2013 14:15:26 -0500 > Serge Hallyn wrote: > > [...] > > +static bool mod_rdep(struct lxc_container *c, bool inc) > > +{ > > + char path[MAXPATHLEN]; > > + int ret, v = 0; > > + FILE *f; > > + bool bret = false; > > + > > +

Re: [lxc-devel] [PATCH] Track snapshot dependencies

2013-08-21 Thread Dwight Engen
On Tue, 20 Aug 2013 14:15:26 -0500 Serge Hallyn wrote: [...] > +static bool mod_rdep(struct lxc_container *c, bool inc) > +{ > + char path[MAXPATHLEN]; > + int ret, v = 0; > + FILE *f; > + bool bret = false; > + > + if (container_disk_lock(c)) > + return false; > +

[lxc-devel] [PATCH] Track snapshot dependencies

2013-08-20 Thread Serge Hallyn
lvm, btrfs, and zfs snapshots each do an ok job of handling deletions for us - a btrfs snapshot does fine after the original is removed, while zfs and lvm will both refuse to allow the original to be deleted while the snapshot exists. Overlayfs doesn't do this for us. So, for overlayfs snapshots,