From: Gabriel de Perthuis <g2p.code+btrfs@gmail.com>
To: Jan Schmidt <list.btrfs@jan-o-sch.net>, linux-btrfs@vger.kernel.org
Cc: Gabriel de Perthuis <g2p.code+btrfs@gmail.com>
Subject: [PATCH] warn when skipping snapshots created with older
Date: Wed, 5 Sep 2012 09:50:05 +0200 [thread overview]
Message-ID: <1346831405-24095-1-git-send-email-g2p.code+btrfs@gmail.com> (raw)
In-Reply-To: <5046D3A0.6060402@jan-o-sch.net>
Thanks, I fixed the objectid test.
Apply with --scissors.
-- >8 --
Subject: [PATCH] btrfs send: warn when skipping snapshots created with older
kernels.
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, to prevent spurious warnings.
Signed-off-by: Gabriel de Perthuis <g2p.code+btrfs@gmail.com>
---
send-utils.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/send-utils.c b/send-utils.c
index a43d47e..03ca72a 100644
--- a/send-utils.c
+++ b/send-utils.c
@@ -224,13 +224,18 @@ 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_FREE_INO_OBJECTID)
+ sh->objectid > BTRFS_LAST_FREE_OBJECTID)
goto skip;
if (sh->type == BTRFS_ROOT_ITEM_KEY) {
/* 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
prev parent reply other threads:[~2012-09-05 7:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-04 16:40 [PATCH] Warn when skipping snapshots created with older kernels Gabriel de Perthuis
2012-09-05 4:22 ` Jan Schmidt
2012-09-05 7:50 ` Gabriel de Perthuis [this message]
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=1346831405-24095-1-git-send-email-g2p.code+btrfs@gmail.com \
--to=g2p.code+btrfs@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=list.btrfs@jan-o-sch.net \
/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).