Btrfs-prog/send: fix wrong best-parent assignment in, find_good_parent()
authorChen Yang <chenyang.fnst@cn.fujitsu.com>
Thu, 24 Jan 2013 11:53:40 +0000 (19:53 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 25 Jan 2013 10:50:51 +0000 (11:50 +0100)
We use find_good_parent() to look for a suit snapshot in the clone source
snapshots as the parent, not the source subvolume of the snapshot which
is about to be sent. fix it

Reviewed-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Cheng Yang <chenyang.fnst@cn.fujitsu.com>
cmds-send.c

index d2f7691..4a8478d 100644 (file)
@@ -152,7 +152,7 @@ static int find_good_parent(struct btrfs_send *s, u64 root_id, u64 *found)
                if (tmp < 0)
                        tmp *= -1;
                if (tmp < best_diff) {
-                       best_parent = parent;
+                       best_parent = parent2;
                        best_diff = tmp;
                }
        }