fuse: Pass correct lend value to filemap_write_and_wait_range()
authorXie Yongji <xieyongji@bytedance.com>
Mon, 22 Nov 2021 09:05:31 +0000 (17:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:54:25 +0000 (10:54 +0100)
commit9668cf9e4af0a0989c5f8f975213a58e74568a17
tree44087ad9579a9467a5acbde1dc43353541b695da
parent9fbaddd783fdc7c074ac9af5aef9baa45596b8b3
fuse: Pass correct lend value to filemap_write_and_wait_range()

commit e388164ea385f04666c4633f5dc4f951fca71890 upstream.

The acceptable maximum value of lend parameter in
filemap_write_and_wait_range() is LLONG_MAX rather than -1. And there is
also some logic depending on LLONG_MAX check in write_cache_pages(). So
let's pass LLONG_MAX to filemap_write_and_wait_range() in
fuse_writeback_range() instead.

Fixes: 59bda8ecee2f ("fuse: flush extending writes")
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Cc: <stable@vger.kernel.org> # v5.15
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/file.c