fuse: fix ioctl when server is 32bit
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 30 Nov 2010 15:39:27 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Jan 2011 22:43:02 +0000 (14:43 -0800)
commit9f68de59cbe6e5458d0b755ed0fc945fddfbc042
tree917cbd9ef34654ad4df2bcffe017f5c847e7d438
parent326aa6201f5e61711e75979dc5022487a88fe548
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>
CC: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/fuse/file.c