* [PATCH] fuse: Pass correct lend value to filemap_write_and_wait_range()
@ 2021-11-22 9:05 Xie Yongji
2021-12-07 11:29 ` Yongji Xie
0 siblings, 1 reply; 3+ messages in thread
From: Xie Yongji @ 2021-11-22 9:05 UTC (permalink / raw)
To: miklos; +Cc: linux-fsdevel
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>
---
fs/fuse/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 9d6c5f6361f7..df81768c81a7 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2910,7 +2910,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)
{
- 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)
fuse_sync_writes(inode);
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: Pass correct lend value to filemap_write_and_wait_range()
2021-11-22 9:05 [PATCH] fuse: Pass correct lend value to filemap_write_and_wait_range() Xie Yongji
@ 2021-12-07 11:29 ` Yongji Xie
2021-12-07 14:22 ` Miklos Szeredi
0 siblings, 1 reply; 3+ messages in thread
From: Yongji Xie @ 2021-12-07 11:29 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-fsdevel
Ping.
On Mon, Nov 22, 2021 at 5:07 PM Xie Yongji <xieyongji@bytedance.com> wrote:
>
> 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>
> ---
> fs/fuse/file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 9d6c5f6361f7..df81768c81a7 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -2910,7 +2910,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)
> {
> - 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)
> fuse_sync_writes(inode);
> --
> 2.11.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: Pass correct lend value to filemap_write_and_wait_range()
2021-12-07 11:29 ` Yongji Xie
@ 2021-12-07 14:22 ` Miklos Szeredi
0 siblings, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2021-12-07 14:22 UTC (permalink / raw)
To: Yongji Xie; +Cc: linux-fsdevel
On Tue, 7 Dec 2021 at 12:30, Yongji Xie <xieyongji@bytedance.com> wrote:
>
> Ping.
>
> On Mon, Nov 22, 2021 at 5:07 PM Xie Yongji <xieyongji@bytedance.com> wrote:
> >
> > 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.
Looks good; applied.
Thanks,
Miklos
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-07 14:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 9:05 [PATCH] fuse: Pass correct lend value to filemap_write_and_wait_range() Xie Yongji
2021-12-07 11:29 ` Yongji Xie
2021-12-07 14:22 ` Miklos Szeredi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).