Skip to contentSkip to conversation

Btrfs-prog/send: fix wrong best-parent assignment in, find_good_parent()

PATCH In review Chen Yang 2 participants 2 messages Jan 24, 2013 Btrfs file system

lore
Share & tools
lore

Chen Yang

author
#0 lore raw

PATCH 1/1 Btrfs-prog/send: fix wrong best-parent assignment in, find_good_parent()

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

---
 cmds-send.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cmds-send.c +1 -1
index 9b47e70..3a88c54 100644
@@ -150,7 +150,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;
 		}
 	}
Signature · 6 lines
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Chen Yang

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

---
 cmds-send.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cmds-send.c +0 -0
index 9b47e70..3a88c54 100644

cmds-send.c static int find_good_parent(struct btrfs_send *s, u64 root_id, u64 *found) · line 156

Quoted 8 lines
cmds-send.c +1 -1
@@ -150,7 +150,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;
 		}
 	}

Thanks,
-Jan