From patchwork Thu Jun 19 01:27:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 4380231 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F949BEEAA for ; Thu, 19 Jun 2014 01:32:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D9EE2038D for ; Thu, 19 Jun 2014 01:32:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A75062038C for ; Thu, 19 Jun 2014 01:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756852AbaFSBcK (ORCPT ); Wed, 18 Jun 2014 21:32:10 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:1557 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756849AbaFSBb7 (ORCPT ); Wed, 18 Jun 2014 21:31:59 -0400 X-IronPort-AV: E=Sophos;i="5.00,735,1396972800"; d="scan'208";a="32121233" Received: from localhost (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 19 Jun 2014 09:28:47 +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 s5J1VO74019665 for ; Thu, 19 Jun 2014 09:31:24 +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:24 +0800 From: Wang Shilong To: Subject: [PATCH 5/6] Btrfs-progs: btrfs-restore, don't allow users to specify -r and -f at the same time Date: Thu, 19 Jun 2014 09:27:08 +0800 Message-ID: <1403141229-25565-5-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 These two options are used for same purpose, but they are exclusive with each other. Make it clear to common users. Signed-off-by: Wang Shilong --- cmds-restore.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmds-restore.c b/cmds-restore.c index 8267ab6..3a29ed6 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -1212,6 +1212,11 @@ int cmd_restore(int argc, char **argv) else if (list_roots && optind >= argc) usage(cmd_restore_usage); + if (fs_location && root_objectid) { + fprintf(stderr, "don't use -f and -r at the same time.\n"); + return 1; + } + if ((ret = check_mounted(argv[optind])) < 0) { fprintf(stderr, "Could not check mount status: %s\n", strerror(-ret));