From 82012736f79d4571d4ce21ff80023f4cd3933e83 Mon Sep 17 00:00:00 2001 From: Luis Henriques Date: Wed, 28 Jun 2017 12:20:51 +0100 Subject: [PATCH] common/rc: handle the case when syscall isn't available _require_xfs_io_command() isn't handling the case where the requested syscall isn't available. To fix this simply check the error returned by xfs_io. Usually the userspace should be synced with kernelspace, the case that a syscall is supported by userspace tool but not kernelspace should not happen, but in rare test setups it's possible, e.g. building an initramfs that contains the testing tools from a recent distro, and running the tests against an old kernel (which does not include such syscall). [ eguan: it's not copy_file_range syscall specific issue, update summary and commit log, and provide more background information ] Signed-off-by: Luis Henriques Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- common/rc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/rc b/common/rc index 2972f89e..57d596cd 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 --" || \