Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org, mwd@md5i.com
Subject: Re: [PATCH] Btrfs-progs: receive: fix the case that we can not find subvolume
Date: Wed, 18 Dec 2013 11:54:15 +0800	[thread overview]
Message-ID: <52B11C67.2010900@cn.fujitsu.com> (raw)
In-Reply-To: <8761qmsup8.fsf@maru2.md5i.com>

Hello Michael,

On 12/18/2013 11:29 AM, Michael Welsh Duggan wrote:
> Miao Xie <miaox@cn.fujitsu.com> writes:
>
>> On Tue, 17 Dec 2013 10:40:41 -0500, Michael Welsh Duggan wrote:
>>> David Sterba <dsterba@suse.cz> writes:
>>>
>>>> On Tue, Dec 17, 2013 at 05:13:49PM +0800, Wang Shilong wrote:
>>>>> If we change our default subvolume, btrfs receive will fail to find
>>>>> subvolume. To fix this problem, i have two ideas.
>>>>>
>>>>> 1.make btrfs snapshot ioctl support passing source subvolume's
>>>>> objectid
>>>>> 2.when we want to using interval subvolume path, we mount it other
>>>>> place
>>>>> that use subvolume 5 as its default subvolume.
>>>> 3. Tell the user to mount the toplevel subvol by himself and run
>>>> receive
>>>>     again
>>> Ugh.  I hope that would be considered a short-term hack waiting for a
>>> better solution, perhaps requiring a kernel upgrade.  From a user's
>>> perspective there is no reason this should be necessary, and requiring
>>> this would be extraordinarily surprising.  "Why is btrfs unable to find
>>> my snapshot?  It's right there!"  Moreover, this used to work just fine
>>> in previous versions of btrfs-progs.
>> Though the snapshot is still in the fs, it is inaccessible because you
>> mount
>> some subvolume as the root, and you can not find the path to the snapshot.
>>
>> For example:
>> There are two subvolumes in the fs, and they are in the root directory
>> of the
>> fs, just like
>> 	real root directory
>> 	 |->subv0
>> 	 |->subv1
>>
>> Then if you mount the subv1 as the root directory, the real root
>> directory of
>> the fs and subv0 will be shielded,
>> 	+-------------------+
>> 	|real root directory|
>> 	| |->subv0          |
>> 	+-------------------+
>> 	  |->subv1
>> you can only access the files, directories, subvolumes... in the subv1. So the tool
>> will report "can not find ...."
>>
>> BTW, it is impossible that the previous version of btrfs-progs can work well in
>> this case.
> In that case I either misunderstand completely, or my problem is almost
> decidedly different.  To recap, this is the command that failed:
>
>      # ./btrfs send -p /snapshots/bo /snapshots/bp | ./btrfs receive /backup/snapshots/root/
>      At subvol /snapshots/bp
>      At snapshot bp
>      ioctl(BTRFS_IOC_TREE_SEARCH, uuid, key 48f0ebae83fd32f1, UUID_KEY, 90139d8200afeaab) ret=-1, error: No such file or directory
>      ioctl(BTRFS_IOC_TREE_SEARCH, uuid, key 48f0ebae83fd32f1, UUID_KEY, 90139d8200afeaab) ret=-1, error: No such file or directory
>      ERROR: could not find parent subvolume
>
It seems that you use older kernel version but use the latest 
btrfs-progs, new btrfs-progs use uuid tree to search but
this tree did not exist yet.

Can you try to upgrade your kernel?

Thanks,
Wang

  reply	other threads:[~2013-12-18  3:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17  9:13 [PATCH] Btrfs-progs: receive: fix the case that we can not find subvolume Wang Shilong
2013-12-17 15:09 ` David Sterba
2013-12-17 15:27   ` Wang Shilong
2013-12-17 15:40   ` Michael Welsh Duggan
2013-12-18  2:55     ` Miao Xie
2013-12-18  3:29       ` Michael Welsh Duggan
2013-12-18  3:54         ` Wang Shilong [this message]
2013-12-18  4:06           ` Michael Welsh Duggan
2013-12-18  5:03             ` Wang Shilong
2013-12-18 20:57               ` Michael Welsh Duggan
2013-12-20  2:33                 ` Michael Welsh Duggan
2013-12-19 16:48     ` 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=52B11C67.2010900@cn.fujitsu.com \
    --to=wangsl.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mwd@md5i.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