btrfs-progs: Fix btrfs fi show by uuid and label

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.

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.

Signed-off-by: Justin Maggard <jmaggard10@gmail.com>
Reviewed-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
Justin Maggard 2014-12-23 11:34:52 -08:00 committed by David Sterba
parent 0f38766b8f
commit 7d83db5bae
1 changed files with 2 additions and 7 deletions

View File

@ -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;
/*
* Needs special handling if input arg is block dev And if