From patchwork Thu Jun 19 01:27:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 4380221 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7FF579F26E for ; Thu, 19 Jun 2014 01:32:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A712420386 for ; Thu, 19 Jun 2014 01:32:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4E9D20380 for ; Thu, 19 Jun 2014 01:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756901AbaFSBcM (ORCPT ); Wed, 18 Jun 2014 21:32:12 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:42711 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756848AbaFSBb7 (ORCPT ); Wed, 18 Jun 2014 21:31:59 -0400 X-IronPort-AV: E=Sophos;i="5.00,735,1396972800"; d="scan'208";a="32121231" Received: from localhost (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 19 Jun 2014 09:28:44 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s5J1VMU9019662 for ; Thu, 19 Jun 2014 09:31:22 +0800 Received: from wangs.fnst.cn.fujitsu.com (10.167.226.104) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 19 Jun 2014 09:31:23 +0800 From: Wang Shilong To: Subject: [PATCH 4/6] Btrfs-progs: btrfs-restore, output resason why it fails to read root Date: Thu, 19 Jun 2014 09:27:07 +0800 Message-ID: <1403141229-25565-4-git-send-email-wangsl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1403141229-25565-1-git-send-email-wangsl.fnst@cn.fujitsu.com> References: <1403141229-25565-1-git-send-email-wangsl.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.104] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Previously if restore could not read users specified fs root, it would output following message: Error reading root With this patch, it will output message like: Fail to read root 1000: No such file or directory Signed-off-byr Wang Shilong --- cmds-restore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmds-restore.c b/cmds-restore.c index 48c46ff..8267ab6 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -1257,7 +1257,8 @@ int cmd_restore(int argc, char **argv) key.offset = (u64)-1; root = btrfs_read_fs_root(orig_root->fs_info, &key); if (IS_ERR(root)) { - fprintf(stderr, "Error reading root\n"); + fprintf(stderr, "fail to read root %llu: %s\n", + root_objectid, strerror(-PTR_ERR(root))); root = orig_root; ret = 1; goto out;