All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] btrfs-progs: Show error message if btrfs filesystem show failed to find any btrfs filesystem
@ 2014-08-11  9:13 Satoru Takeuchi
  2014-08-19 15:17 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Satoru Takeuchi @ 2014-08-11  9:13 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

Current btrfs doesn't display any error message if this command
failed to find any btrfs filesystem corresponding to
<path>|<uuid>|<device>|<label> which user specified.

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

---
 cmds-filesystem.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 7633f1f..2f78e24 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -695,6 +695,7 @@ static int cmd_show(int argc, char **argv)
 		ret = btrfs_scan_kernel(search);
 	if (search && !ret) {
 		/* since search is found we are done */
+		found = 1;
 		goto out;
 	}
 
@@ -729,6 +730,15 @@ devs_only:
 		btrfs_close_devices(fs_devices);
 	}
 out:
+	if (search && !found) {
+		fprintf(stderr,
+			"ERROR: Couldn't find any btrfs filesystem "
+			"matches with '%s'.\n", search);
+		fprintf(stderr,
+			"Please check if both '%s' and the range of scanning "
+			"are correct.\n", search);
+	}
+
 	printf("%s\n", BTRFS_BUILD_VERSION);
 	free_seen_fsid();
 	return ret;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-19 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11  9:13 [PATCH 3/3] btrfs-progs: Show error message if btrfs filesystem show failed to find any btrfs filesystem Satoru Takeuchi
2014-08-19 15:17 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.