From patchwork Thu Oct 30 06:34:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 5193901 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 B8D499F349 for ; Thu, 30 Oct 2014 06:34:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11DC320260 for ; Thu, 30 Oct 2014 06:34:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 649692034A for ; Thu, 30 Oct 2014 06:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756050AbaJ3GeK (ORCPT ); Thu, 30 Oct 2014 02:34:10 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:17729 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751127AbaJ3GeJ (ORCPT ); Thu, 30 Oct 2014 02:34:09 -0400 X-IronPort-AV: E=Sophos;i="5.04,817,1406563200"; d="scan'208";a="42586444" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Oct 2014 14:30:57 +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 s9U6Xwkt012446; Thu, 30 Oct 2014 14:33:58 +0800 Received: from adam-work.localdomain (10.167.226.33) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 30 Oct 2014 14:34:05 +0800 From: Qu Wenruo To: CC: Subject: [PATCH] btrfs-progs: Fix the argument requirement for '--subvol-extents' Date: Thu, 30 Oct 2014 14:34:06 +0800 Message-ID: <1414650846-23767-1-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.1.2 MIME-Version: 1.0 X-Originating-IP: [10.167.226.33] 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 following commit changed the argument requirement for '--subvol-extents', which causes it to call arg_strtou64() on NULL, resulting a segfault. d34cbe76 btrfs-progs: check: do not require argument for --subvol-extents This patch revert the patch and change the help string and man page to make it no longer confusing. Signed-off-by: Qu Wenruo --- Documentation/btrfs-check.txt | 2 ++ cmds-check.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/btrfs-check.txt b/Documentation/btrfs-check.txt index 8a8073f..821bfc9 100644 --- a/Documentation/btrfs-check.txt +++ b/Documentation/btrfs-check.txt @@ -32,6 +32,8 @@ create a new CRC tree. create a new extent tree. --check-data-csum:: verify checkums of data blocks. +--subvol-extents :: +show extent state for a subvolume. EXIT STATUS ----------- diff --git a/cmds-check.c b/cmds-check.c index 2a5f823..923fb10 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -7544,7 +7544,7 @@ static struct option long_options[] = { { "init-extent-tree", 0, NULL, 0 }, { "check-data-csum", 0, NULL, 0 }, { "backup", 0, NULL, 0 }, - { "subvol-extents", no_argument, NULL, 'E' }, + { "subvol-extents", 1, NULL, 'E' }, { "qgroup-report", 0, NULL, 'Q' }, { NULL, 0, NULL, 0} }; @@ -7560,7 +7560,7 @@ const char * const cmd_check_usage[] = { "--init-extent-tree create a new extent tree", "--check-data-csum verify checkums of data blocks", "--qgroup-report print a report on qgroup consistency", - "--subvol-extents print subvolume extents and sharing state", + "--subvol-extents print subvolume extents and sharing state", NULL };