From patchwork Wed Mar 9 01:19:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yauhen Kharuzhy X-Patchwork-Id: 8541201 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 56F23C0553 for ; Wed, 9 Mar 2016 01:20:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D57E20155 for ; Wed, 9 Mar 2016 01:20:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 712D120138 for ; Wed, 9 Mar 2016 01:20:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbcCIBUB (ORCPT ); Tue, 8 Mar 2016 20:20:01 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:36088 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbcCIBTr (ORCPT ); Tue, 8 Mar 2016 20:19:47 -0500 Received: by mail-pf0-f180.google.com with SMTP id 63so25922817pfe.3 for ; Tue, 08 Mar 2016 17:19:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1TXcQUxRXkTqWZ7AmUbHki4u62wpgCIeKbDnXWps8qM=; b=CdAWU1zS25iIBE7cXiKsg0fiXgXY4K2Q4G7Ya7fy2EhE5k2ylxprPUgk5QCAHqT4lH FQAbC9Y1rHcR9gRlNUPMseGF28tUr9PbcVQRoWvis+yPVsPxvVNFAMEE1Ys4a13iNilZ mYdQYNYB1DqfnCgV+N4tTZrpFNeRykK4mI6b7a2rXJ6+Nm9EvNCyGaZSBteg7/p+A97N c630PCivrplMGv9kKcqrvo33cTIQ0xKioXoDlMPlBYsh8uFKAO2IwPquGtaxO4khW3Z9 lH0b+9cPZxNy+12fI7k0KLAS2yYkF9J/0vXujgFivRnTYheUp3hAj1wQEcet/qYbQSr5 isKw== X-Gm-Message-State: AD7BkJIEtV3c1D54a6g3kFWIBvaeN4vEPvsKW4s6IJQNgOop1AE9TXxGX5MHQRne78BkFg== X-Received: by 10.98.11.70 with SMTP id t67mr21430287pfi.109.1457486386858; Tue, 08 Mar 2016 17:19:46 -0800 (PST) Received: from jek-Latitude-E7440 (pat.hitachigst.com. [199.255.44.5]) by smtp.gmail.com with ESMTPSA id y15sm7657940pfi.16.2016.03.08.17.19.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Mar 2016 17:19:46 -0800 (PST) Received: from jek by jek-Latitude-E7440 with local (Exim 4.86) (envelope-from ) id 1adSmv-000142-MG; Tue, 08 Mar 2016 17:19:45 -0800 From: Yauhen Kharuzhy To: linux-btrfs@vger.kernel.org Cc: Yauhen Kharuzhy Subject: [PATCH] Fix broken 'device scan' arguments parsing Date: Tue, 8 Mar 2016 17:19:40 -0800 Message-Id: <1457486380-4051-1-git-send-email-yauhen.kharuzhy@zavadatar.com> X-Mailer: git-send-email 2.5.0 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, 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 commit 52179e4fea41e55f31c92cd033a0b53a5107b4f4 'btrfs-progs: unify argc min/max checking' brokes 'btrfs device scan' command when no argument was given. Fix this. Signed-off-by: Yauhen Kharuzhy --- cmds-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-device.c b/cmds-device.c index cb470af..94ffdc5 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -273,7 +273,7 @@ static int cmd_device_scan(int argc, char **argv) if (all && check_argc_max(argc - optind, 1)) usage(cmd_device_scan_usage); - if (all || argc - optind == 1) { + if (all || argc - optind == 0) { printf("Scanning for Btrfs filesystems\n"); ret = btrfs_scan_lblkid(); error_on(ret, "error %d while scanning", ret);