linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
To: Gui Hecheng <guihc.fnst@cn.fujitsu.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] btrfs-progs: refine btrfs-debug-tree error prompt when a mount point given
Date: Thu, 25 Dec 2014 15:49:16 +0900	[thread overview]
Message-ID: <549BB36C.6030606@jp.fujitsu.com> (raw)
In-Reply-To: <1419470195-2889-2-git-send-email-guihc.fnst@cn.fujitsu.com>

On 2014/12/25 10:16, Gui Hecheng wrote:
> Now, if exec:
> 	# btrfs-debug-tree <mount_point>
> it echos:
> 	: Superblock bytenr is larger than device size
> 
> But it is quite misleading, because it is a valid btrfs.
> In this case, we should tell the developer to provide a block device.
> 
> After apply:
> 	: '<mount_point>' is not a block device
> 	: 'usage: btrfs-debug-tree [options] device
> 
> Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
> ---
>   btrfs-debug-tree.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c
> index e46500d..7f079a9 100644
> --- a/btrfs-debug-tree.c
> +++ b/btrfs-debug-tree.c
> @@ -179,6 +179,12 @@ int main(int ac, char **av)
>   	if (check_argc_exact(ac, 1))
>   		print_usage();
>   
> +	ret = check_arg_type(av[optind]);
> +	if (ret != BTRFS_ARG_BLKDEV) {
> +		fprintf(stderr, "'%s' is not a block device\n", av[optind]);

fprintf(stderr, "ERROR: '%s' is ...)" is better since
other error messages in btrfs-progs have this convention.

Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

Thanks,
Satoru

> +		print_usage();
> +	}
> +
>   	info = open_ctree_fs_info(av[optind], 0, 0, OPEN_CTREE_PARTIAL);
>   	if (!info) {
>   		fprintf(stderr, "unable to open %s\n", av[optind]);
> 


  reply	other threads:[~2014-12-25  6:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-25  1:16 [PATCH 1/2] btrfs-progs: move check_arg_type() to util.c Gui Hecheng
2014-12-25  1:16 ` [PATCH 2/2] btrfs-progs: refine btrfs-debug-tree error prompt when a mount point given Gui Hecheng
2014-12-25  6:49   ` Satoru Takeuchi [this message]
2014-12-25  7:23     ` Gui Hecheng
2014-12-29 16:29   ` David Sterba
2014-12-25  6:43 ` [PATCH 1/2] btrfs-progs: move check_arg_type() to util.c Satoru Takeuchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=549BB36C.6030606@jp.fujitsu.com \
    --to=takeuchi_satoru@jp.fujitsu.com \
    --cc=guihc.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).