path: root/cmds-replace.c
diff options
authorGui Hecheng <>2014-06-05 10:02:52 +0800
committerDavid Sterba <>2014-08-22 14:41:15 +0200
commit4da2751451ffa2757f11b8433fdf02c949c5e21e (patch)
treebaae6d6b623e1fa4ceab15523bfff8e50eaf55db /cmds-replace.c
parent2da5099c6930fbd179a5cd8a72dc0688e07826de (diff)
btrfs-progs: show meaningful msgs for replace cmd upon raid56
This depends on the kernel patch: [PATCH] btrfs:replace EINVAL with EOPNOTSUPP for dev_replace This catches the EOPNOTSUPP and output msg that says dev_replace raid56 is not currently supported. Note that the msg will only be shown when run dev_replace not in background. Signed-off-by: Gui Hecheng <> Signed-off-by: David Sterba <>
Diffstat (limited to 'cmds-replace.c')
1 files changed, 5 insertions, 0 deletions
diff --git a/cmds-replace.c b/cmds-replace.c
index 186a127f..9fe7ad85 100644
--- a/cmds-replace.c
+++ b/cmds-replace.c
@@ -308,6 +308,11 @@ static int cmd_start_replace(int argc, char **argv)
"ERROR: ioctl(DEV_REPLACE_START) failed on \"%s\": %s, %s\n",
path, strerror(errno),
+ if (errno == EOPNOTSUPP)
+ fprintf(stderr,
+ "WARNING: dev_replace does not yet handle RAID5/6\n");
goto leave_with_error;