Skip to content

Commit

Permalink
btrfs-progs: fi show: print error message if no valid Btrfs is specified
Browse files Browse the repository at this point in the history
* Before this patch

 ===============================
 # ./btrfs fi show foo      # "foo" doesn't mean any valid Btrfs
 #                          # no error message
 # echo $?
 1
 ===============================

* After this patch

 ===============================
 # ./btrfs fi show foo
 ERROR: foo is not a valid Btrfs
 #
 # echo $?
 1
 ===============================

Signed-off-by: Satoru Takeuchi <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
Satoru Takeuchi authored and kdave committed Jun 24, 2016
1 parent cd9b35c commit 0346432
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmds-filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,9 +898,10 @@ static int cmd_filesystem_show(int argc, char **argv)
list_for_each_entry(fs_devices, &all_uuids, list)
print_one_uuid(fs_devices, unit_mode);

if (search && !found)
if (search && !found) {
error("not a valid btrfs filesystem: %s", search);
ret = 1;

}
while (!list_empty(&all_uuids)) {
fs_devices = list_entry(all_uuids.next,
struct btrfs_fs_devices, list);
Expand Down

0 comments on commit 0346432

Please sign in to comment.