Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
To: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Cc: <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:23:55 +0800	[thread overview]
Message-ID: <1419492235.1717.2.camel@localhost.localdomain> (raw)
In-Reply-To: <549BB36C.6030606@jp.fujitsu.com>

On Thu, 2014-12-25 at 15:49 +0900, Satoru Takeuchi wrote:
> 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.

Yes, it is good to make it clear about the "ERROR", but since there is
no "ERROR" word throughout the source file, I think I would make all
error prompts to start with the "ERROR" word globally in the progs in
another patch.

Thanks,
Gui

> 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  7:25 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
2014-12-25  7:23     ` Gui Hecheng [this message]
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=1419492235.1717.2.camel@localhost.localdomain \
    --to=guihc.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=takeuchi_satoru@jp.fujitsu.com \
    /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