From: Miklos Szeredi mszeredi@redhat.com
commit 8aab336b14c115c6bf1d4baeb9247e41ed9ce6de upstream.
Make sure filesystem is not returning a bogus number of bytes written.
Fixes: ea9b9907b82a ("fuse: implement perform_write") Cc: stable@vger.kernel.org # v2.6.26 Signed-off-by: Miklos Szeredi mszeredi@redhat.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
--- fs/fuse/file.c | 2 ++ 1 file changed, 2 insertions(+)
--- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1098,6 +1098,8 @@ static ssize_t fuse_send_write_pages(str ia->write.in.flags = fuse_write_flags(iocb);
err = fuse_simple_request(fc, &ap->args); + if (!err && ia->write.out.size > count) + err = -EIO;
offset = ap->descs[0].offset; count = ia->write.out.size;