linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@gmail.com>
To: Darrell Enns <darrell@darrellenns.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Backup failing with "failed to clone extents" error
Date: Tue, 31 Aug 2021 12:21:33 +0100	[thread overview]
Message-ID: <CAL3q7H5p9WBravwa6un5jsQUb24a+Xw1PvKpt=iBdHp4wirm8g@mail.gmail.com> (raw)
In-Reply-To: <CAL3q7H6h+_7P7BG11V1VXaLe+6M+Nt=mT3n51nZ2iqXSZFUmOA@mail.gmail.com>

On Tue, Aug 31, 2021 at 12:20 PM Filipe Manana <fdmanana@gmail.com> wrote:
>
> On Tue, Aug 31, 2021 at 3:46 AM Darrell Enns <darrell@darrellenns.com> wrote:
> >
> > Debug output from the latest patch attached. Here's the error:
> > BTRFS info (device dm-3): clone: -EINVAL other, src 400186 (root 2792)
> > dst 400186 (root 2792), off 79134720 destoff 79134720 len 4751360 olen
> > 4751360, src i_size 83886080 dst i_size 83886080 bs 4096 remap_flags 0
>
> Yep, the same weird thing as before.
>
> So the receiving filesystem gets that error, which is perfectly valid
> since we are asking to clone from the same inode to the same inode in
> the same root (snapshot) with the same source and destination offsets
> - source range and target range overlap, whence the error.
>
> However, if we go the dmesg log:
>
> [   99.834090] BTRFS info (device dm-0): send: clone_range() start ino
> 400698 offset 79134720 send root 977, clone root 881 ino 400698 offset
> 79134720 data_offset 491520 len 4751360 disk_byte 308100730880
> clone_src_i_size 83886080 next_write_offset 79134720
> [   99.834094] BTRFS info (device dm-0): send: clone_range() step 1
> ino 400698 offset 79134720, root offset 79134720 ino 400698
> data_offset 491520 len 4751360, key.offset 78675968 ext_len 5210112
> clone_data_offset 32768 found disk_byte 308100730880 next_write_offset
> 79134720
> [   99.834096] BTRFS info (device dm-0): send: clone_range() step
> 2-1-2 ino 400698 offset 79134720, root offset 79134720 ino 400698
> data_offset 491520 len 4751360, clone_len 4751360
> [   99.834112] BTRFS info (device dm-0): send: clone_range() end ino
> 400698 offset 79134720 send root 977, clone root 881 ino 400698 offset
> 79134720 data_offset 491520 len 0 disk_byte 308100730880
> clone_src_i_size 83886080 next_write_offset 79134720 ret 0
>
> We see that send is issuing a clone command using different roots
> (snapshots) for the clone operation (send root is 977 and clone root
> is 881).
> The root/snapshot IDs are different in the source and destination
> filesystems - that's normal and it's what happens most of the time.
> However I don't understand how is the inode number different, nor much
> less how the receiver attempts to use the same root/snapshot as both
> the source and destination for the clone operation - it should use
> different roots/snapshots.
>
> Ok, so, here's another kernel debug patch and also a patch for
> btrfs-progs, both added as attachments.
>
> The kernel one also at:  https://pastebin.com/raw/nfHfRuy7
> And the progs one also at:  https://pastebin.com/raw/9CbN9C0H
>
> When you run 'btrfs receive', you'll have to pass '-vvv' to it in
> order to get the debug output.
>
> Also, please provide the output of:
>
> 1) btrfs subvolume list -puqR <source fs mount path>
> 2) btrfs subvolume list -puqR <destination fs mount path>
> 3) cat /proc/mounts
>
> I'm starting to suspect that somewhere, possibly the receiving side,
> we make confusion with the snapshot uuids or generate wrong paths for
> the clone operation.

Also, what's the btrfs-progs version being used? (type "btrfs
--version" to get it)

>
> Thanks!
>
>
>
> --
> Filipe David Manana,
>
> “Whether you think you can, or you think you can't — you're right.”



-- 
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”

  reply	other threads:[~2021-08-31 11:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 23:22 Backup failing with "failed to clone extents" error Darrell Enns
2021-08-26  9:48 ` Filipe Manana
2021-08-26 18:30   ` Darrell Enns
2021-08-27 11:35     ` Filipe Manana
2021-08-27 18:01       ` Darrell Enns
2021-08-27 19:31         ` Filipe Manana
2021-08-27 21:04           ` Darrell Enns
2021-08-30 10:51             ` Filipe Manana
2021-08-30 16:38               ` Filipe Manana
2021-08-30 17:37                 ` Darrell Enns
2021-08-30 18:34                   ` Filipe Manana
2021-08-30 19:08                     ` Darrell Enns
2021-08-30 19:52                       ` Filipe Manana
2021-08-30 20:08                         ` Darrell Enns
2021-08-30 20:11                           ` Darrell Enns
2021-08-30 20:58                           ` Filipe Manana
2021-08-31  2:46                             ` Darrell Enns
2021-08-31 11:20                               ` Filipe Manana
2021-08-31 11:21                                 ` Filipe Manana [this message]
2021-08-31 16:48                                   ` Darrell Enns
2021-09-01 14:50                                     ` Filipe Manana
2021-09-01 15:34                                       ` Andrei Borzenkov
2021-09-01 15:37                                         ` Filipe Manana
2021-09-01 17:16                                       ` Darrell Enns
2021-09-01 17:40                                         ` Andrei Borzenkov
2021-09-01 17:52                                           ` Darrell Enns
2021-09-01 18:16                                             ` Andrei Borzenkov
2021-09-01 18:28                                               ` Darrell Enns
  -- strict thread matches above, loose matches on Subject: below --
2020-04-16  0:31 Matt Huszagh
2020-04-16 11:53 ` Filipe Manana

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='CAL3q7H5p9WBravwa6un5jsQUb24a+Xw1PvKpt=iBdHp4wirm8g@mail.gmail.com' \
    --to=fdmanana@gmail.com \
    --cc=darrell@darrellenns.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;
as well as URLs for NNTP newsgroup(s).