Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2015 18:12:05 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283496 - head/sys/compat/linux
Message-ID:  <201505241812.t4OIC5so046585@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sun May 24 18:12:04 2015
New Revision: 283496
URL: https://svnweb.freebsd.org/changeset/base/283496

Log:
  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.

Modified:
  head/sys/compat/linux/linux_ioctl.c
  head/sys/compat/linux/linux_ioctl.h

Modified: head/sys/compat/linux/linux_ioctl.c
==============================================================================
--- head/sys/compat/linux/linux_ioctl.c	Sun May 24 18:11:22 2015	(r283495)
+++ head/sys/compat/linux/linux_ioctl.c	Sun May 24 18:12:04 2015	(r283496)
@@ -3596,9 +3596,16 @@ linux_ioctl(struct thread *td, struct li
 	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);
 }

Modified: head/sys/compat/linux/linux_ioctl.h
==============================================================================
--- head/sys/compat/linux/linux_ioctl.h	Sun May 24 18:11:22 2015	(r283495)
+++ head/sys/compat/linux/linux_ioctl.h	Sun May 24 18:12:04 2015	(r283496)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505241812.t4OIC5so046585>