diff mbox

btrfs-progs: send: fix handling of multiple snapshots

Message ID 201603240747.AA00000@WIN-5MHF4RKU941.jp.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Tsutomu Itoh March 24, 2016, 7:47 a.m. UTC
We cannot send multiple snapshots at once.

[before fix]
# btrfs send ./snap[12] > snap12.data
At subvol ./snap1
At subvol ./snap2
ERROR: parent determination failed for 0
#

[after fix]
# btrfs send ./snap[12] > snap12.data
At subvol ./snap1
At subvol ./snap2
#

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
---
 cmds-send.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

David Sterba March 24, 2016, 2:24 p.m. UTC | #1
On Thu, Mar 24, 2016 at 04:47:28PM +0900, Tsutomu Itoh wrote:
> We cannot send multiple snapshots at once.
> 
> [before fix]
> # btrfs send ./snap[12] > snap12.data
> At subvol ./snap1
> At subvol ./snap2
> ERROR: parent determination failed for 0
> #
> 
> [after fix]
> # btrfs send ./snap[12] > snap12.data
> At subvol ./snap1
> At subvol ./snap2
> #
> 
> Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-send.c b/cmds-send.c
index 3e34d75..a220a49 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -683,15 +683,16 @@  int cmd_send(int argc, char **argv)
 		if (ret < 0)
 			goto out;
 
-		/* done with this subvol, so add it to the clone sources */
-		ret = add_clone_source(&send, root_id);
-		if (ret < 0) {
-			error("not enough memory");
-			goto out;
+		if (!full_send) {
+			/* done with this subvol, so add it to the clone sources */
+			ret = add_clone_source(&send, root_id);
+			if (ret < 0) {
+				error("not enough memory");
+				goto out;
+			}
 		}
 
 		parent_root_id = 0;
-		full_send = 0;
 	}
 
 	ret = 0;