btrfs-progs: make receive work inside of subvolumes
authorJosef Bacik <jbacik@fb.com>
Wed, 10 Jun 2015 19:05:51 +0000 (15:05 -0400)
committerDavid Sterba <dsterba@suse.cz>
Fri, 12 Jun 2015 12:39:57 +0000 (14:39 +0200)
commitb47fdc73c317ab9737304ab52ce09d8a1191ea88
treec8ffcb141c6245229b559b748a8ac8c0a5ebd7b4
parent6d7999d5b747283314c0f3833a3d9515f674a446
btrfs-progs: make receive work inside of subvolumes

Kind of a big feature of btrfs is being able to have a default subvol.  However
the receive code generates the paths to the subvols from the root of the fs,
even in the case of a default subvol.  So instead figure out if we're inside of
a subvol, either because we have a different default or we've chroot'ed and are
using -m.  Then strip this extra path off of the subvol we find so we can look
up our parent properly.  Thanks

Reported-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-receive.c