[PATCH 2/2 v2] common/rc: handle xfs_io copy_range when copy_file_range syscall isn't available

Luis Henriques
2017-06-28T11:20:56Z

_require_xfs_io_command() isn't handling the case where the copy_file_range
syscall isn't available. To fix this simply check the error returned by
xfs_io.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
---
Changes since v1:
- dropped check that worked around an xfs_io bug.

common/rc | 2 ++
1 file changed, 2 insertions(+)

diff --git a/common/rc b/common/rc
index 2972f89e9527..57d596cd4f2e 100644
--- a/common/rc
+++ b/common/rc
@@ -2195,6 +2195,8 @@ _require_xfs_io_command()
_notrun "xfs_io $command failed (old kernel/wrong fs/bad args?)"
echo $testio | grep -q "foreign file active" && \
_notrun "xfs_io $command not supported on $FSTYP"
+ echo $testio | egrep -q "Function not implemented" && \
+ _notrun "xfs_io $command support is missing (missing syscall?)"

if [ -n "$param" -a $param_checked -eq 0 ]; then
$XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \