All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 2/3] btrfs-progs: send: fix handling of multiple snapshots (-p option)
Date: Wed, 19 Oct 2016 11:35:03 +0900	[thread overview]
Message-ID: <201610190235.AA00002@WIN-5MHF4RKU941.jp.fujitsu.com> (raw)

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>
---
 cmds-send.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/cmds-send.c b/cmds-send.c
index dfdfe01..2a8a697 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;
-- 
2.9.3

             reply	other threads:[~2016-10-19  2:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19  2:35 Tsutomu Itoh [this message]
2016-10-28 15:10 ` [PATCH 2/3] btrfs-progs: send: fix handling of multiple snapshots (-p option) David Sterba
2016-11-02  1:11   ` Tsutomu Itoh
2016-11-02 12:05     ` David Sterba
2016-11-15  8:44 ` Tsutomu Itoh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201610190235.AA00002@WIN-5MHF4RKU941.jp.fujitsu.com \
    --to=t-itoh@jp.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.