From 5989b75bdb56d04cb6dd15034fc006fe3931338b Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Sun, 24 May 2015 18:12:04 +0000 Subject: [PATCH] The latest cp tool is trying to use the btrfs clone operation that is implemented via ioctl interface. First of all return ENOTSUP for this operation as a cp fallback to usual method in that case. Secondly, do not print out the message about unimplemented operation. --- sys/compat/linux/linux_ioctl.c | 13 ++++++++++--- sys/compat/linux/linux_ioctl.h | 6 ++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 1af201e7ef7..572060e8f05 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -3596,9 +3596,16 @@ linux_ioctl(struct thread *td, struct linux_ioctl_args *args) sx_sunlock(&linux_ioctl_sx); fdrop(fp, td); - linux_msg(td, "ioctl fd=%d, cmd=0x%x ('%c',%d) is not implemented", - args->fd, (int)(args->cmd & 0xffff), - (int)(args->cmd & 0xff00) >> 8, (int)(args->cmd & 0xff)); + switch (args->cmd & 0xffff) { + case LINUX_BTRFS_IOC_CLONE: + return (ENOTSUP); + + default: + linux_msg(td, "ioctl fd=%d, cmd=0x%x ('%c',%d) is not implemented", + args->fd, (int)(args->cmd & 0xffff), + (int)(args->cmd & 0xff00) >> 8, (int)(args->cmd & 0xff)); + break; + } return (EINVAL); } diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index 9419152c6a9..873937deecd 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -744,6 +744,12 @@ #define FBSD_LUSB_MAX 0xffff #define FBSD_LUSB_MIN 0xffdd +/* + * Linux btrfs clone operation + */ +#define LINUX_BTRFS_IOC_CLONE 0x9409 /* 0x40049409 */ + + /* * Pluggable ioctl handlers */