]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: use received_uuid of parent during send
authorJosef Bacik <jbacik@fb.com>
Thu, 4 Jun 2015 21:17:25 +0000 (17:17 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 12:27:44 +0000 (04:27 -0800)
commit8b560ba10213035d26175414056926844e99f711
treeef6b36727c0203aa10df4827272a8431714d68c7
parent2df9412cb4f6a8be11ad0557f7d4ca3bcc0d79df
Btrfs: use received_uuid of parent during send

Neil Horman pointed out a problem where if he did something like this

receive A
snap A B
change B
send -p A B

and then on another box do

recieve A
receive B

the receive B would fail because we use the UUID of A for the clone sources for
B.  This makes sense most of the time because normally you are sending from the
original sources, not a received source.  However when you use a recieved subvol
its UUID is going to be something completely different, so if you then try to
receive the diff on a different volume it won't find the UUID because the new A
will be something else.  The only constant is the received uuid.  So instead
check to see if we have received_uuid set on the root, and if so use that as the
clone source, as btrfs receive looks for matches either in received_uuid or
uuid.  Thanks,

Reported-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Hugo Mills <hugo@carfax.org.uk>
Signed-off-by: Chris Mason <clm@fb.com>
Orabug: 22580612
Mainline v4.2 commit 37b8d27de5d0079e1ecef2711061048e13054ebe
Signed-off-by: bo.li.liu@oracle.com
fs/btrfs/send.c