From 7d83db5bae5420d7b1c7f4e64897c25bc9a94f09 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Tue, 23 Dec 2014 11:34:52 -0800 Subject: 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 Reviewed-by: Gui Hecheng Signed-off-by: David Sterba --- cmds-filesystem.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'cmds-filesystem.c') 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; /* * Needs special handling if input arg is block dev And if -- cgit v1.2.1