linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Peter Grandi <pg@btrfs.list.sabi.co.UK>,
	Linux fs Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: What means "top level" in "btrfs subvolume list" ?
Date: Sat, 30 Sep 2017 19:38:35 +0300	[thread overview]
Message-ID: <ba6dad59-602b-61d8-8e55-1aa37028db29@gmail.com> (raw)
In-Reply-To: <22991.45029.564275.154171@tree.ty.sabi.co.uk>

30.09.2017 17:53, Peter Grandi пишет:
>> I am trying to figure out which means "top level" in the
>> output of "btrfs sub list"
> 
> The terminology (and sometimes the detailed behaviour) of Btrfs
> is not extremely consistent, I guess because of permissive
> editorship of the design, in a "let 1000 flowers bloom" sort
> of fashion so that does not matter a lot.
> 
>> [ ... ] outputs a "top level ID" equal to the "parent ID" (on
>> the basis of the code).
> 
> You could have used option '-p' and it would have printed out
> both "top level ID" and "parent ID" for extra enlightenment.
> 

How does it explain what "top level" is?

>> But I am still asking which would be the RIGHT "top level id".
> 
> But perhaps one of them is now irrelevant, because 'man btrfs
> subvolume says:
> 
>   "If -p is given, then parent <ID> is added to the output
>   between ID and top level. The parent’s ID may be used at mount
>   time via the subvolrootid= option."
> 
> and 'man 5 btrfs' says:
> 
>   "subvolrootid=objectid
>     (irrelevant since: 3.2, formally deprecated since: 3.10)
>     A workaround option from times (pre 3.2) when it was not
>     possible to mount a subvolume that did not reside directly
>     under the toplevel subvolume."
> 

This still does not explain what "top level" in "btrfs sub list" means.

>> My Hypothesis, it should be the ID of the root subvolume ( or
>> 5 if it is not mounted). [ ... ]
> 
> Well, a POSIX filesystem typically has a root directory, and it
> can be mounted as the system root or any other point. A Btrfs
> filesystem has multiple root directories, that are mounted by
> default "somewhere" (a design decision that I think was unwise,
> but "whatever").
> 
> The subvolume containing the mountpoint directory of another
> subvolume's root directory is is no way or sense its "parent",
> as there is no derivation relationship; root directories are
> independent of each other and their mountpoint is (or should be)
> a runtime entity.
> 

With all respect that is not how it looks like. Each subvolume has very
precise relationship to containing subvolume; you can only traverse
subvolumes via this very explicit relationship. The fact that subvolumes
can also be mounted individually on VFS level is rather irrelevant for
filesystem structure.

Whether "parent" is correct name for containing subvolume is of course
subject to opinion, but for me it fits - subvolumes do form a tree and
have very well defined parent/child relationship.

> If there is a "parent" relationship that maybe be between
> snapshot and origin subvolume (ignoring 'send'/'receive'...),

Yes, having the same name for entirely different types of hierarchical
relationships is unfortunate. But it still does not explain what "top
level" means :)

  reply	other threads:[~2017-09-30 16:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-30 11:57 What means "top level" in "btrfs subvolume list" ? Goffredo Baroncelli
2017-09-30 14:53 ` Peter Grandi
2017-09-30 16:38   ` Andrei Borzenkov [this message]
2017-10-02 19:07   ` Goffredo Baroncelli
2017-10-01  7:49 ` Andrei Borzenkov

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=ba6dad59-602b-61d8-8e55-1aa37028db29@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=pg@btrfs.list.sabi.co.UK \
    /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).