summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2019-04-24 18:05:06 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2019-04-24 18:05:06 +0300
commit9de5be06d0a89ca97b5ab902694d42dfd2bb77d2 (patch)
tree6bee5c6e567702d3c8b98bfed6961a4eb17ae9dc /fs/fuse
parent085b7755808aa11f78ab9377257e1dad2e6fa4bb (diff)
downloadlinux-9de5be06d0a89ca97b5ab902694d42dfd2bb77d2.tar.xz
fuse: fix writepages on 32bit
Writepage requests were cropped to i_size & 0xffffffff, which meant that mmaped writes to any file larger than 4G might be silently discarded. Fix by storing the file size in a properly sized variable (loff_t instead of size_t). Reported-by: Antonio SJ Musumeci <trapexit@spawn.link> Fixes: 6eaf4782eb09 ("fuse: writepages: crop secondary requests") Cc: <stable@vger.kernel.org> # v3.13 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 06096b60f1df..5428c81879b2 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1586,7 +1586,7 @@ __acquires(fi->lock)
{
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_inode *fi = get_fuse_inode(inode);
- size_t crop = i_size_read(inode);
+ loff_t crop = i_size_read(inode);
struct fuse_req *req;
while (fi->writectr >= 0 && !list_empty(&fi->queued_writes)) {