aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2009-06-28 21:26:53 -0400
committerMiklos Szeredi <mszeredi@suse.cz>2009-06-30 14:06:23 -0400
commitb4c458b3a23d76936e76678f2074b1528f129f7a (patch)
tree5b256bf81066e41442fa776cb668156bb4d58804
parent28d0325ce6e0a52f53d8af687e6427fee59004d3 (diff)
fuse: fix return value of fuse_dev_write()
On 64 bit systems -- where sizeof(ssize_t) > sizeof(int) -- the following test exposes a bug due to a non-careful return of an int or unsigned value: implement a FUSE filesystem which sends an unsolicited notification to the kernel with invalid opcode. The respective write to /dev/fuse will return (1 << 32) - EINVAL with errno == 0 instead of -1 with errno == EINVAL. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: stable@kernel.org
-rw-r--r--fs/fuse/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 8fed2ed12f38..8a11a8c67c42 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -910,7 +910,7 @@ static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,
910 unsigned long nr_segs, loff_t pos) 910 unsigned long nr_segs, loff_t pos)
911{ 911{
912 int err; 912 int err;
913 unsigned nbytes = iov_length(iov, nr_segs); 913 size_t nbytes = iov_length(iov, nr_segs);
914 struct fuse_req *req; 914 struct fuse_req *req;
915 struct fuse_out_header oh; 915 struct fuse_out_header oh;
916 struct fuse_copy_state cs; 916 struct fuse_copy_state cs;