From: Omar Sandoval <osandov@osandov.com>
To: dsterba@suse.cz, "Eric W. Biederman" <ebiederm@xmission.com>,
Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
Timo Kokkonen <timo.kokkonen@offcode.fi>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Btrfs: prevent deletion of mounted subvolumes
Date: Fri, 3 Apr 2015 14:08:37 -0700 [thread overview]
Message-ID: <20150403210837.GA13535@mew.dhcp4.washington.edu> (raw)
In-Reply-To: <20150402150225.GJ6821@twin.jikos.cz>
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/btrfs/super.c
> > index 05fef19..a74ddb3 100644
> > --- a/fs/btrfs/super.c
> > +++ b/fs/btrfs/super.c
> > @@ -1024,6 +1024,8 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
> > struct btrfs_root *root = info->tree_root;
> > char *compress_type;
> >
> > + seq_printf(seq, ",subvolid=%llu",
> > + BTRFS_I(d_inode(dentry))->root->root_key.objectid);
>
> yes, subvolid is reliable, but not very friendly from users' POV. I'd
> like to see subvol=/path there. Possibly we can have both.
So are you saying that we should try to fix the bug in userspace by
first getting subvol/subvolid in /proc/mounts, or do you want to keep
that a separate issue? Just asking because you didn't comment on the
kernel-side fix. Here's a concrete implementation of what I'm talking
about: https://github.com/osandov/linux/tree/btrfs-delete-mounted-subvol.
--
Omar
prev parent reply other threads:[~2015-04-03 21:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <64e28e67cbab0a2cd97411b848911414a743d83f.1427705646.git.osandov@osandov.com>
[not found] ` <20150330123034.GB32051@suse.cz>
2015-03-30 18:41 ` [PATCH] Btrfs: prevent deletion of mounted subvolumes Omar Sandoval
2015-04-01 3:54 ` Eric W. Biederman
2015-04-01 7:03 ` Omar Sandoval
2015-04-01 7:27 ` Timo Kokkonen
2015-04-01 11:22 ` David Sterba
2015-04-02 3:49 ` Omar Sandoval
2015-04-02 15:02 ` David Sterba
2015-04-03 21:08 ` Omar Sandoval [this message]
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=20150403210837.GA13535@mew.dhcp4.washington.edu \
--to=osandov@osandov.com \
--cc=clm@fb.com \
--cc=dsterba@suse.cz \
--cc=ebiederm@xmission.com \
--cc=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=timo.kokkonen@offcode.fi \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).