From patchwork Tue Sep 4 16:40:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel de Perthuis X-Patchwork-Id: 1403421 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4A3014025E for ; Tue, 4 Sep 2012 16:41:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932483Ab2IDQlq (ORCPT ); Tue, 4 Sep 2012 12:41:46 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:59236 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757187Ab2IDQlp (ORCPT ); Tue, 4 Sep 2012 12:41:45 -0400 Received: from moulinex (unknown [IPv6:2a01:e35:8a2c:b230:995d:3a6b:a17b:e0b8]) by smtp1-g21.free.fr (Postfix) with ESMTP id AD5AF9401DA; Tue, 4 Sep 2012 18:41:36 +0200 (CEST) Received: from g2p by moulinex with local (Exim 4.76) (envelope-from ) id 1T8wBz-0001pR-C2; Tue, 04 Sep 2012 18:41:35 +0200 From: Gabriel de Perthuis To: linux-btrfs@vger.kernel.org Cc: Gabriel de Perthuis Subject: [PATCH] Warn when skipping snapshots created with older kernels. Date: Tue, 4 Sep 2012 18:40:58 +0200 Message-Id: <1346776858-6208-1-git-send-email-g2p.code+btrfs@gmail.com> X-Mailer: git-send-email 1.7.12.117.gdc24c27 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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 --- 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 *)