fuse: fix writepages on 32bit
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 24 Apr 2019 15:05:06 +0000 (17:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 May 2019 16:23:30 +0000 (18:23 +0200)
commita452f733f93e943d991fd98da1fda20e4cec77d1
treea96d56257ef65a2bd263415252077d7148df892e
parent42f59b83f0cf547a2236b0e1e4d0c785db9af6e8
fuse: fix writepages on 32bit

commit 9de5be06d0a89ca97b5ab902694d42dfd2bb77d2 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/file.c