All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Cc: Shriramana Sharma <samjnaa@gmail.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Possible to undo subvol delete?
Date: Wed, 3 Dec 2014 19:48:43 +0100	[thread overview]
Message-ID: <20141203184843.GW12140@suse.cz> (raw)
In-Reply-To: <20141202152555.GA17395@hungrycats.org>

On Tue, Dec 02, 2014 at 10:25:55AM -0500, Zygo Blaxell wrote:
> On Tue, Dec 02, 2014 at 01:52:52PM +0100, David Sterba wrote:
> > > On a side note...only root can delete subvolumes, but non-root users
> > > can create them, which results in...this:
> > > 
> > > 	$ /sbin/btrfs sub create foo
> > > 	Create subvolume './foo'
> > > 	$ date > foo/bar
> > > 	$ /sbin/btrfs sub delete foo
> > > 	Transaction commit: none (default)
> > > 	Delete subvolume '/home/testuser/foo'
> > > 	ERROR: cannot delete '/home/testuser/foo' - Operation not permitted
> > > 	$ rm -rf foo
> > > 	rm: cannot remove `foo': Operation not permitted
> > > 	$ cat /proc/version
> > > 	Linux version 3.17.1-zb64+ (root@buildbot) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP PREEMPT Tue Oct 21 00:17:49 EDT 2014
> > > 
> > > ...uh oh?
> > 
> > That's how it works now. I'd like to enable the user to delete their
> > subvolumes even without the user_subvol_rm_allowed option someday.
> 
> That seems...odd.  It should be symmetrical, i.e. if you can create a
> subvol you should be able to delete it, and if can't delete a subvol
> then you shouldn't be able to create them either.

It should and I don't know the exact reasons why it's been restricted.
AFAICS it should be safe to enable the user_subvol_rm_allowed mode by
default.

> I can imagine
> quite a bit of havoc could be wrought by an unprivileged user creating
> subvols indiscriminately (or in various specific, targeted locations).

Is this different from creating directories the same way?

There is a difference in metadata consumption between subvolume and
directory, but this would lead to "just" ENOSPC.

  reply	other threads:[~2014-12-03 18:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30  3:33 Possible to undo subvol delete? Shriramana Sharma
2014-11-30  4:23 ` Marc MERLIN
2014-12-01 13:12   ` Austin S Hemmelgarn
2014-12-01 13:19     ` Shriramana Sharma
2014-12-01 13:46       ` Roman Mamedov
2014-12-01 16:39         ` Shriramana Sharma
2014-12-02  3:14           ` Zygo Blaxell
2014-12-02  3:40             ` Shriramana Sharma
2014-12-02  5:39               ` MegaBrutal
2014-12-02 12:56               ` David Sterba
2014-12-02 15:15                 ` Shriramana Sharma
2014-12-03 18:53                   ` David Sterba
2014-12-04 14:06                     ` Shriramana Sharma
2014-12-04 14:18                       ` Austin S Hemmelgarn
2014-12-05 17:46                       ` David Sterba
2014-12-05 17:56                         ` Shriramana Sharma
2014-12-05 18:11                           ` Shriramana Sharma
2014-12-08 13:01                             ` Austin S Hemmelgarn
2014-12-08 14:16                               ` Shriramana Sharma
2014-12-08 14:53                                 ` Austin S Hemmelgarn
2014-12-02 12:52             ` David Sterba
2014-12-02 14:09               ` Hugo Mills
2014-12-03 18:26                 ` David Sterba
2014-12-03 19:54                   ` Zygo Blaxell
2014-12-05 17:55                     ` David Sterba
2014-12-02 15:25               ` Zygo Blaxell
2014-12-03 18:48                 ` David Sterba [this message]
2014-12-03 19:49                   ` Zygo Blaxell
2014-12-02  5:33           ` MegaBrutal
2014-12-02  5:50             ` Marc MERLIN
2014-12-01 13:38     ` MegaBrutal
2014-12-01 13:47       ` Roman Mamedov
2014-12-01 13:54         ` MegaBrutal
2014-12-01 16:40           ` Shriramana Sharma
2014-12-01 17:19             ` Robert White
2014-12-01 17:24           ` Austin S Hemmelgarn
2014-12-01 13:50       ` Austin S Hemmelgarn
2014-12-01 17:28         ` David Sterba
2014-12-01 13:50       ` Holger Hoffstätte
2014-12-01 17:35     ` David Sterba
2014-12-02  7:11 ` Satoru Takeuchi
2014-12-02 15:17   ` Shriramana Sharma
2014-12-03  0:11     ` Satoru Takeuchi
2014-12-03  2:35       ` Shriramana Sharma
2014-12-03 19:17         ` David Sterba
2014-12-03 19:12       ` David Sterba
2014-12-04  4:46         ` Satoru Takeuchi
2014-12-03 19:06   ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141203184843.GW12140@suse.cz \
    --to=dsterba@suse.cz \
    --cc=ce3g8jdj@umail.furryterror.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=samjnaa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.