summaryrefslogtreecommitdiff
path: root/ioctl.h
diff options
context:
space:
mode:
authorEryu Guan <guaneryu@gmail.com>2014-10-10 21:16:16 +0800
committerDavid Sterba <dsterba@suse.cz>2014-11-03 18:35:30 +0100
commit39893bb15ef39ee2ed254d931faf9c67d6c47e37 (patch)
tree981b505484cefc9e5fb16fe4d6f9384799bc22e8 /ioctl.h
parent44cdb62d3478c834f41c87ea79d261b9c8982dce (diff)
btrfs-progs: only report internal dev replace result if there's a result
If BTRFS_IOC_DEV_REPLACE ioctl failed, args.result usually won't be updated by the ioctl. And the arg has been initialized with 0, the result is always 0, which is BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR, and the resulting error message looks confusing: ERROR: ioctl(DEV_REPLACE_START) failed on "/mnt/btrfs": No such file or directory, no error But in case there's an internal result returned in future, don't drop the result completely, instead print dev replace result message only if the result is updated by a failed ioctl call. Signed-off-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'ioctl.h')
-rw-r--r--ioctl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ioctl.h b/ioctl.h
index f0fc0608..df9e4b7a 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -141,6 +141,7 @@ struct btrfs_ioctl_dev_replace_status_params {
#define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0
#define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1
#define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2
+#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_RESULT -1
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1
#define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2