public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Andrei Borzenkov <arvidjaar@gmail.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: how do I know a subvolume is a snapshot?
Date: Wed, 17 Jul 2019 21:16:27 +0300	[thread overview]
Message-ID: <730be7c4-8990-17ec-68ca-c64d05fd41d6@suse.com> (raw)
In-Reply-To: <8394b9da-f334-3e6c-83c2-3225ae0733b9@gmail.com>



On 17.07.19 г. 20:39 ч., Andrei Borzenkov wrote:
> 17.07.2019 14:19, Nikolay Borisov пишет:
>>
>> This is really odd... So this indeed seems to be a userspace problem. 
> 
> 
> Of course it is user space problem.
> 
> commit 0a0a03554aaf56a6e7245e74fa7d8b3c53f1c20f
> Author: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
> Date:   Fri Mar 23 17:16:49 2018 +0900
> 
>     btrfs-progs: mkfs: add uuid and otime to ROOT_ITEM of, FS_TREE
> 
>     Currently, the top-level subvolume lacks the UUID. As a result, both
>     non-snapshot subvolume and snapshot of top-level subvolume do not have
>     Parent UUID and cannot be distinguisued. Therefore "fi show" of
>     top-level lists all the subvolumes which lacks the UUID in
>     "Snapshot(s)" filed.  Also, it lacks the otime information.
> 
>     Fix this by adding the UUID and otime at the mkfs time.  As a
>     consequence, snapshots of top-level subvolume now have a Parent UUID and
>     UUID tree will create an entry for top-level subvolume at mount time.
>     This should not cause the problem for current kernel, but user program
>     which relies on the empty Parent UUID may be affected by this change.
> 
> 
> What about the question - is there tool to fix existing filesystem by
> adding this information?

Short answer - no. Long answer - it would be trivial to add something
like that to btrfstune but this will only work for root volumes. Because
for snapshots you'd have to iterate all snapshots for a subvol, ensure
they haven't really changed i.e. are real snapshosts and then populate
their Parent UUID to that of the newly set UUID of their respective parent.

> 

      reply	other threads:[~2019-07-17 18:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 23:24 how do I know a subvolume is a snapshot? Ulli Horlacher
2019-07-17  7:45 ` Bernhard Kühnel
2019-07-17  8:05   ` Ulli Horlacher
2019-07-17 10:33   ` Remi Gauvin
2019-07-17  8:23 ` Hans van Kranenburg
2019-07-17  8:57   ` misono.tomohiro
2019-07-17  9:06     ` Ulli Horlacher
2019-07-17  9:24       ` misono.tomohiro
2019-07-17  8:24 ` Nikolay Borisov
2019-07-17  9:11   ` Ulli Horlacher
2019-07-17 10:11     ` Nikolay Borisov
2019-07-17 10:29       ` Andrei Borzenkov
2019-07-17 11:19         ` Nikolay Borisov
2019-07-17 17:39           ` Andrei Borzenkov
2019-07-17 18:16             ` Nikolay Borisov [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=730be7c4-8990-17ec-68ca-c64d05fd41d6@suse.com \
    --to=nborisov@suse.com \
    --cc=arvidjaar@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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