diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2016-10-19 11:35:03 +0900 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-09 13:13:47 +0100 |
commit | 6d4fb3dcc13fdd3e04917bc656c8926116d13e44 (patch) | |
tree | 6d6f5653236494c1a19065688982bf40742b50d3 /cmds-send.c | |
parent | cf5a680b82909382b8e8546748d2a6811a167e41 (diff) |
btrfs-progs: send: fix handling of multiple snapshots (-p option)
We cannot send multiple snapshots at once by -p option.
[before]
# btrfs send -f /tmp/data0 -p Snap0 Snap[12]
At subvol Snap1
At subvol Snap2
ERROR: parent determination failed for 0
#
[after]
# btrfs send -f /tmp/data0 -p Snap0 Snap[12]
At subvol Snap1
At subvol Snap2
#
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-send.c')
-rw-r--r-- | cmds-send.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cmds-send.c b/cmds-send.c index dfdfe018..2a8a697a 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -650,7 +650,7 @@ int cmd_send(int argc, char **argv) goto out; } - if (!full_send && !parent_root_id) { + if (!full_send && root_id) { ret = find_good_parent(&send, root_id, &parent_root_id); if (ret < 0) { error("parent determination failed for %lld", @@ -673,7 +673,7 @@ int cmd_send(int argc, char **argv) if (ret < 0) goto out; - if (!full_send) { + if (!full_send && root_id) { /* done with this subvol, so add it to the clone sources */ ret = add_clone_source(&send, root_id); if (ret < 0) { @@ -681,8 +681,6 @@ int cmd_send(int argc, char **argv) goto out; } } - - parent_root_id = 0; } ret = 0; |