[RHEL7,COMMIT] fuse: support FS_IOC_FIEMAP in i386 compat mode

Submitted by Konstantin Khorenko on April 27, 2018, 8:53 a.m.

Details

Message ID 201804270853.w3R8rFda030951@finist_ce7.work
State New
Series "fuse: support FS_IOC_FIEMAP in i386 compat mode"
Headers show

Commit Message

Konstantin Khorenko April 27, 2018, 8:53 a.m.
The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.47.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.46.7
------>
commit b55b49a5ca9b1401e400b2ea65d179d79951a4d6
Author: Alexey Kuznetsov <kuznet@virtuozzo.com>
Date:   Fri Apr 27 11:53:15 2018 +0300

    fuse: support FS_IOC_FIEMAP in i386 compat mode
    
    https://jira.sw.ru/browse/PSBM-83731
    
    Signed-off-by: Alexey Kuznetsov <kuznet@virtuozzo.com>
---
 fs/fuse/file.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 7e22154e398c..43733920fd7e 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -3294,6 +3294,10 @@  static long fuse_file_ioctl(struct file *file, unsigned int cmd,
 static long fuse_file_compat_ioctl(struct file *file, unsigned int cmd,
 				   unsigned long arg)
 {
+	/* Paradoxically, this is how FS_IOC_FIEMAP actually supported in compat mode */
+	if (cmd == FS_IOC_FIEMAP)
+		return -ENOIOCTLCMD;
+
 	return fuse_ioctl_common(file, cmd, arg, FUSE_IOCTL_COMPAT);
 }