From patchwork Thu May 15 01:29:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Hecheng X-Patchwork-Id: 4179021 X-Patchwork-Delegate: dave@jikos.cz 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 EC73B9F485 for ; Thu, 15 May 2014 01:33:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FFC7201F2 for ; Thu, 15 May 2014 01:33:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 506052034B for ; Thu, 15 May 2014 01:33:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752197AbaEOBdx (ORCPT ); Wed, 14 May 2014 21:33:53 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:56665 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752002AbaEOBdx (ORCPT ); Wed, 14 May 2014 21:33:53 -0400 X-IronPort-AV: E=Sophos;i="4.97,1055,1389715200"; d="scan'208";a="30541270" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 15 May 2014 09:31:20 +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 s4F1XpeM007585 for ; Thu, 15 May 2014 09:33:51 +0800 Received: from localhost.localdomain (10.167.226.111) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.146.2; Thu, 15 May 2014 09:33:51 +0800 From: Gui Hecheng To: CC: Gui Hecheng Subject: [PATCH 3/3] btrfs-progs: use check_argc_exact to check arg number of btrfs-rescue Date: Thu, 15 May 2014 09:29:09 +0800 Message-ID: <1400117349-2851-3-git-send-email-guihc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1400117349-2851-1-git-send-email-guihc.fnst@cn.fujitsu.com> References: <1400117349-2851-1-git-send-email-guihc.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.111] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The btrfs-rescue accepts exactly one arg for both chunk-recover & super-recover, use check_argc_exact clearly. --- cmds-rescue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-rescue.c b/cmds-rescue.c index 9491d0c..3629141 100644 --- a/cmds-rescue.c +++ b/cmds-rescue.c @@ -85,7 +85,7 @@ int cmd_chunk_recover(int argc, char *argv[]) } argc = argc - optind; - if (argc == 0) + if (check_argc_exact(argc, 1)) usage(cmd_chunk_recover_usage); file = argv[optind]; @@ -141,7 +141,7 @@ int cmd_super_recover(int argc, char **argv) } } argc = argc - optind; - if (argc != 1) + if (check_argc_exact(argc, 1)) usage(cmd_super_recover_usage); dname = argv[optind];