From 0f70b67a0c280ee1801412e0080aae8ad4eae98b Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Thu, 30 Oct 2014 14:34:06 +0800 Subject: [PATCH] btrfs-progs: Fix the argument requirement for '--subvol-extents' 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 Signed-off-by: David Sterba --- 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 8a8073f5..821bfc9a 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 2a5f823d..923fb10c 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 };