linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
To: Justin Maggard <jmaggard10@gmail.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs-progs: Fix btrfs fi show by uuid and label
Date: Wed, 24 Dec 2014 09:28:56 +0800	[thread overview]
Message-ID: <1419384536.20397.3.camel@localhost.localdomain> (raw)
In-Reply-To: <1419363292-12271-1-git-send-email-jmaggard10@gmail.com>

On Tue, 2014-12-23 at 11:34 -0800, Justin Maggard wrote:
> Commit 8be2fff (btrfs-progs: apply realpath for btrfs fi
> show when mount point is given) changed the behavior of
> btrfs fi show to return an error if the call to realpath()
> failed.  This broke the ability to specify a filesystem by
> uuid or label.

Oh, that's my fault, thanks for correcting this.

> So let's not consider a failed call to realpath() as an
> error.  If the user really specified a bad device, just
> return nothing like we did before.
> ---
>  cmds-filesystem.c |    9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/cmds-filesystem.c b/cmds-filesystem.c
> index 8f037dd..a654e6f 100644
> --- a/cmds-filesystem.c
> +++ b/cmds-filesystem.c
> @@ -901,13 +901,8 @@ static int cmd_show(int argc, char **argv)
>  		 *     realpath do  /mnt/btrfs/  => /mnt/btrfs
>  		 *     which shall be recognized by btrfs_scan_kernel()
>  		 */
> -		if (!realpath(search, path)) {
> -			fprintf(stderr, "ERROR: Could not show %s: %s\n",
> -					search, strerror(errno));
> -			return 1;
> -		}
> -
> -		search = path;
> +		if (realpath(search, path))
> +			search = path;

This looks nice and stay consistent with the behavior before my faulty
commit.

Reviewed-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>

Thanks,
Gui

>  		/*
>  		 * Needs special handling if input arg is block dev And if



      reply	other threads:[~2014-12-24  1:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 19:34 [PATCH] btrfs-progs: Fix btrfs fi show by uuid and label Justin Maggard
2014-12-24  1:28 ` Gui Hecheng [this message]

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=1419384536.20397.3.camel@localhost.localdomain \
    --to=guihc.fnst@cn.fujitsu.com \
    --cc=jmaggard10@gmail.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).