common/rc: handle the case when syscall isn't available
authorLuis Henriques <lhenriques@suse.com>
Wed, 28 Jun 2017 11:20:51 +0000 (12:20 +0100)
committerEryu Guan <eguan@redhat.com>
Thu, 29 Jun 2017 05:52:12 +0000 (13:52 +0800)
commit82012736f79d4571d4ce21ff80023f4cd3933e83
tree40d650146a20eaf28273c53af6d988587c3b8dea
parent591b5d75b834234c2530e9049984003f29661516
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 <lhenriques@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/rc