From: David Sterba <dsterba@suse.cz>
To: Omar Sandoval <osandov@osandov.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
David Sterba <dsterba@suse.cz>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] Btrfs: show subvol= and subvolid= in /proc/mounts
Date: Thu, 9 Apr 2015 17:56:30 +0200 [thread overview]
Message-ID: <20150409155630.GF25622@twin.jikos.cz> (raw)
In-Reply-To: <213f0b6a4cffcc82688894b4edbaeb51f8e71137.1428471096.git.osandov@osandov.com>
On Tue, Apr 07, 2015 at 10:34:02PM -0700, Omar Sandoval wrote:
> Currently, userspace has no way to know which subvolume is mounted.
Oh, there is a way, 'btrfs inspect-internal rootid /path/to/mount', just
we'd like to see it in the mount options as well.
> But,
> now that we're guaranteed to have a meaningful root dentry, we can just
> export and use seq_dentry() in btrfs_show_options(). The subvolume ID is
> easy to get, so put that in there, too.
>
> Signed-off-by: Omar Sandoval <osandov@osandov.com>
> ---
> fs/btrfs/super.c | 4 ++++
> fs/seq_file.c | 1 +
> 2 files changed, 5 insertions(+)
>
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 5ab9801..5e14bb6 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1193,6 +1193,10 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
> seq_puts(seq, ",fatal_errors=panic");
> if (info->commit_interval != BTRFS_DEFAULT_COMMIT_INTERVAL)
> seq_printf(seq, ",commit=%d", info->commit_interval);
> + seq_puts(seq, ",subvol=");
Please make subvol= the last one, as it can contain any string that
could be confused with other options. Although nobody would probably
call their subvolume "name,autodefrag" etc, the way to obtain the full
path is to either resolve the subvolid, or take the whole text after
"subvol=" to the end of the line.
> + seq_dentry(seq, dentry, " \t\n\\");
> + seq_printf(seq, ",subvolid=%llu",
> + BTRFS_I(d_inode(dentry))->root->root_key.objectid);
> return 0;
prev parent reply other threads:[~2015-04-09 15:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 5:33 [PATCH 0/3] Btrfs: show subvolume name and ID " Omar Sandoval
2015-04-08 5:34 ` [PATCH 1/3] Btrfs: lock superblock before remounting for rw subvol Omar Sandoval
2015-04-08 5:34 ` [PATCH 2/3] Btrfs: unify subvol= and subvolid= mounting Omar Sandoval
2015-04-08 6:06 ` Qu Wenruo
2015-04-08 7:17 ` Omar Sandoval
2015-04-08 7:36 ` Qu Wenruo
2015-04-09 16:10 ` David Sterba
2015-04-10 0:33 ` Qu Wenruo
2015-04-09 16:28 ` David Sterba
2015-04-09 19:03 ` Omar Sandoval
2015-04-08 5:34 ` [PATCH 3/3] Btrfs: show subvol= and subvolid= in /proc/mounts Omar Sandoval
2015-04-08 5:57 ` Qu Wenruo
2015-04-09 15:56 ` David Sterba [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=20150409155630.GF25622@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=clm@fb.com \
--cc=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=osandov@osandov.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®