Btrfs: use BTRFS_ERROR_DEV_MISSING_NOT_FOUND when missing device is not found
authorAnand Jain <anand.jain@oracle.com>
Fri, 14 Aug 2015 10:32:56 +0000 (18:32 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 1 Oct 2015 14:47:16 +0000 (16:47 +0200)
Use btrfs specific error code BTRFS_ERROR_DEV_MISSING_NOT_FOUND instead
of -ENOENT.  Next this removes the logging when user specifies "missing"
and we don't find it in the kernel device list. Logging are for system
events not for user input errors.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index 99f294c..c3e2591 100644 (file)
@@ -2041,10 +2041,8 @@ int btrfs_find_device_missing_or_by_path(struct btrfs_root *root,
                        }
                }
 
-               if (!*device) {
-                       btrfs_err(root->fs_info, "no missing device found");
-                       return -ENOENT;
-               }
+               if (!*device)
+                       return BTRFS_ERROR_DEV_MISSING_NOT_FOUND;
 
                return 0;
        } else {