fuse: fix ioctl when server is 32bit
commit986afbde0f1dde7695987fd2458f9676ce0389aa
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 30 Nov 2010 15:39:27 +0000 (30 16:39 +0100)
committerAK <andi@firstfloor.org>
Sun, 6 Feb 2011 19:03:24 +0000 (6 11:03 -0800)
treece93ad2132484d3ecb6f33f6b3233aed4b16ebde
parent84e4371b03088be955408911af51904c66a5b43e
fuse: fix ioctl when server is 32bit

commit d9d318d39dd5cb686660504a3565aac453709ccc upstream.

If a 32bit CUSE server is run on 64bit this results in EIO being
returned to the caller.

The reason is that FUSE_IOCTL_RETRY reply was defined to use 'struct
iovec', which is different on 32bit and 64bit archs.

Work around this by looking at the size of the reply to determine
which struct was used.  This is only needed if CONFIG_COMPAT is
defined.

A more permanent fix for the interface will be to use the same struct
on both 32bit and 64bit.

Reported-by: "ccmail111" <ccmail111@yahoo.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
CC: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/fuse/file.c