summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2016-01-09 18:03:09 +0000
committerdchagin <dchagin@FreeBSD.org>2016-01-09 18:03:09 +0000
commitb7998c86633f09c39691f8220d67f9b9147d68f0 (patch)
tree22d038b925a38794dcd8510ecfbab4d2f5040a99 /sys/compat
parent8f96e27e049a1090b1c13e788bd487a52e6c6867 (diff)
downloadFreeBSD-src-b7998c86633f09c39691f8220d67f9b9147d68f0.zip
FreeBSD-src-b7998c86633f09c39691f8220d67f9b9147d68f0.tar.gz
MFC r283496:
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.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_ioctl.c13
-rw-r--r--sys/compat/linux/linux_ioctl.h6
2 files changed, 16 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index 3dcf13b..8858e2f 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -3595,9 +3595,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 9419152..873937d 100644
--- a/sys/compat/linux/linux_ioctl.h
+++ b/sys/compat/linux/linux_ioctl.h
@@ -745,6 +745,12 @@
#define FBSD_LUSB_MIN 0xffdd
/*
+ * Linux btrfs clone operation
+ */
+#define LINUX_BTRFS_IOC_CLONE 0x9409 /* 0x40049409 */
+
+
+/*
* Pluggable ioctl handlers
*/
struct linux_ioctl_args;
OpenPOWER on IntegriCloud