]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Btrfs: send, don't error in the presence of subvols/snapshots
authorFilipe Manana <fdmanana@gmail.com>
Sun, 25 May 2014 03:49:24 +0000 (04:49 +0100)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:20:59 +0000 (17:20 -0700)
commit1af56070e3ef9477dbc7eba3b9ad7446979c7974
treed6685f9c0cbff57135a11fe573fbb2e0779a5d16
parenta79b7d4b3e8118f265dcb4bdf9a572c392f02708
Btrfs: send, don't error in the presence of subvols/snapshots

If we are doing an incremental send and the base snapshot has a
directory with name X that doesn't exist anymore in the second
snapshot and a new subvolume/snapshot exists in the second snapshot
that has the same name as the directory (name X), the incremental
send would fail with -ENOENT error. This is because it attempts
to lookup for an inode with a number matching the objectid of a
root, which doesn't exist.

Steps to reproduce:

    mkfs.btrfs -f /dev/sdd
    mount /dev/sdd /mnt

    mkdir /mnt/testdir
    btrfs subvolume snapshot -r /mnt /mnt/mysnap1

    rmdir /mnt/testdir
    btrfs subvolume create /mnt/testdir
    btrfs subvolume snapshot -r /mnt /mnt/mysnap2

    btrfs send -p /mnt/mysnap1 /mnt/mysnap2 -f /tmp/send.data

A test case for xfstests follows.

Reported-by: Robert White <rwhite@pobox.com>
Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/send.c