From: Gabriel de Perthuis <g2p.code+btrfs@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Gabriel de Perthuis <g2p.code+btrfs@gmail.com>
Subject: [PATCH] Warn when skipping snapshots created with older kernels.
Date: Tue, 4 Sep 2012 18:40:58 +0200 [thread overview]
Message-ID: <1346776858-6208-1-git-send-email-g2p.code+btrfs@gmail.com> (raw)
This message is more explicit than "ERROR: could not resolve root_id",
the message that will be shown immediately before `btrfs send` bails.
Also skip invalid high OIDs.
Signed-off-by: Gabriel de Perthuis <g2p.code+btrfs@gmail.com>
---
send-utils.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/send-utils.c b/send-utils.c
index a43d47e..386aeb3 100644
--- a/send-utils.c
+++ b/send-utils.c
@@ -224,6 +224,7 @@ int subvol_uuid_search_init(int mnt_fd, struct subvol_uuid_search *s)
if ((sh->objectid != 5 &&
sh->objectid < BTRFS_FIRST_FREE_OBJECTID) ||
+ sh->objectid >= BTRFS_LAST_FREE_OBJECTID ||
sh->objectid == BTRFS_FREE_INO_OBJECTID)
goto skip;
@@ -231,6 +232,11 @@ int subvol_uuid_search_init(int mnt_fd, struct subvol_uuid_search *s)
/* older kernels don't have uuids+times */
if (sh->len < sizeof(root_item)) {
root_item_valid = 0;
+ fprintf(stderr,
+ "Ignoring subvolume id %llu, "
+ "btrfs send needs snapshots "
+ "created with kernel 3.6+\n",
+ sh->objectid);
goto skip;
}
root_item_ptr = (struct btrfs_root_item *)
--
1.7.12.117.gdc24c27
next reply other threads:[~2012-09-04 16:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-04 16:40 Gabriel de Perthuis [this message]
2012-09-05 4:22 ` [PATCH] Warn when skipping snapshots created with older kernels Jan Schmidt
2012-09-05 7:50 ` [PATCH] warn when skipping snapshots created with older Gabriel de Perthuis
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=1346776858-6208-1-git-send-email-g2p.code+btrfs@gmail.com \
--to=g2p.code+btrfs@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).