提交 261c49a0 编写于 作者: X Xie Yongji 提交者: Zheng Zengkai

fuse: Pass correct lend value to filemap_write_and_wait_range()

stable inclusion
from stable-v5.10.94
commit 9668cf9e4af0a0989c5f8f975213a58e74568a17
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9668cf9e4af0a0989c5f8f975213a58e74568a17

--------------------------------

commit e388164e 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: 59bda8ec ("fuse: flush extending writes")
Signed-off-by: NXie Yongji <xieyongji@bytedance.com>
Cc: <stable@vger.kernel.org> # v5.15
Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 ab2de4b3
...@@ -3267,7 +3267,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter) ...@@ -3267,7 +3267,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
static int fuse_writeback_range(struct inode *inode, loff_t start, loff_t end) static int fuse_writeback_range(struct inode *inode, loff_t start, loff_t end)
{ {
int err = filemap_write_and_wait_range(inode->i_mapping, start, -1); int err = filemap_write_and_wait_range(inode->i_mapping, start, LLONG_MAX);
if (!err) if (!err)
fuse_sync_writes(inode); fuse_sync_writes(inode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册