Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-03 Thread Omar Sandoval
On Thu, Apr 02, 2015 at 05:02:25PM +0200, David Sterba wrote: > On Wed, Apr 01, 2015 at 08:49:54PM -0700, Omar Sandoval wrote: > > Hm, yeah, that's unfortunate, thanks for pointing that out. It looks > > like we can get the subvolume ID reliably: > > > > > > diff --git a/fs/btrfs/super.c b/fs

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-02 Thread David Sterba
On Wed, Apr 01, 2015 at 08:49:54PM -0700, Omar Sandoval wrote: > Hm, yeah, that's unfortunate, thanks for pointing that out. It looks > like we can get the subvolume ID reliably: > > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > index 05fef19..a74ddb3 100644 > --- a/fs/btrfs/super.c >

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread Omar Sandoval
On Wed, Apr 01, 2015 at 01:22:42PM +0200, David Sterba wrote: > On Wed, Apr 01, 2015 at 12:03:28AM -0700, Omar Sandoval wrote: > > --- a/fs/btrfs/super.c > > +++ b/fs/btrfs/super.c > > @@ -1024,6 +1024,10 @@ static int btrfs_show_options(struct seq_file *seq, > > struct dentry *dentry) > > str

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread David Sterba
On Wed, Apr 01, 2015 at 12:03:28AM -0700, Omar Sandoval wrote: > --- a/fs/btrfs/super.c > +++ b/fs/btrfs/super.c > @@ -1024,6 +1024,10 @@ static int btrfs_show_options(struct seq_file *seq, > struct dentry *dentry) > struct btrfs_root *root = info->tree_root; > char *compress_type; >

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread Timo Kokkonen
Hi, On 01.04.2015 10:03, Omar Sandoval wrote: On Tue, Mar 31, 2015 at 10:54:55PM -0500, Eric W. Biederman wrote: Omar Sandoval writes: On Mon, Mar 30, 2015 at 02:30:34PM +0200, David Sterba wrote: On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: Before commit bafc9b754f75 ("v

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-04-01 Thread Omar Sandoval
On Tue, Mar 31, 2015 at 10:54:55PM -0500, Eric W. Biederman wrote: > Omar Sandoval writes: > > > On Mon, Mar 30, 2015 at 02:30:34PM +0200, David Sterba wrote: > >> On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: > >> > Before commit bafc9b754f75 ("vfs: More precise tests in d_inval

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-03-31 Thread Eric W. Biederman
Omar Sandoval writes: > On Mon, Mar 30, 2015 at 02:30:34PM +0200, David Sterba wrote: >> On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: >> > Before commit bafc9b754f75 ("vfs: More precise tests in d_invalidate"), >> > d_invalidate() could return -EBUSY when a dentry for a director

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-03-30 Thread Omar Sandoval
On Mon, Mar 30, 2015 at 02:30:34PM +0200, David Sterba wrote: > On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: > > Before commit bafc9b754f75 ("vfs: More precise tests in d_invalidate"), > > d_invalidate() could return -EBUSY when a dentry for a directory had > > more than one refer

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-03-30 Thread David Sterba
On Mon, Mar 30, 2015 at 02:02:17AM -0700, Omar Sandoval wrote: > Before commit bafc9b754f75 ("vfs: More precise tests in d_invalidate"), > d_invalidate() could return -EBUSY when a dentry for a directory had > more than one reference to it. This is what prevented a mounted > subvolume from being de

Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-03-30 Thread Timo Kokkonen
On 30.03.2015 12:02, Omar Sandoval wrote: Before commit bafc9b754f75 ("vfs: More precise tests in d_invalidate"), d_invalidate() could return -EBUSY when a dentry for a directory had more than one reference to it. This is what prevented a mounted subvolume from being deleted, as struct vfsmount h

[PATCH] Btrfs: prevent deletion of mounted subvolumes

2015-03-30 Thread Omar Sandoval
Before commit bafc9b754f75 ("vfs: More precise tests in d_invalidate"), d_invalidate() could return -EBUSY when a dentry for a directory had more than one reference to it. This is what prevented a mounted subvolume from being deleted, as struct vfsmount holds a reference to the subvolume dentry. Ho