[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3f28825a-dc00-4a34-a9e5-d8d1ddb4184f@ustc.edu>
Date: Mon, 19 Jan 2026 16:34:49 +0800
From: Chunsheng Luo <luochunsheng@...c.edu>
To: miklos@...redi.hu
Cc: amir73il@...il.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/3] fuse: use offset_in_folio() for large folio offset
calculations
Dear Community Members,
I sincerely apologize for the email that was mistakenly sent earlier due
to an operational error on my part.
Please kindly ignore the previous message, and if possible, you may
delete it from your inbox.
My deepest apologies for any inconvenience this may have caused.
Thanks
Chunsheng Luo
On 1/19/26 4:23 PM, Chunsheng Luo wrote:
> On 1/17/26 7:56 AM, Joanne Koong wrote:
>> Use offset_in_folio() instead of manually calculating the folio offset.
>>
>> Signed-off-by: Joanne Koong <joannelkoong@...il.com>
>> ---
>> fs/fuse/dev.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
>> index 698289b5539e..4dda4e24cc90 100644
>> --- a/fs/fuse/dev.c
>> +++ b/fs/fuse/dev.c
>> @@ -1812,7 +1812,7 @@ static int fuse_notify_store(struct fuse_conn *fc, unsigned int size,
>> if (IS_ERR(folio))
>> goto out_iput;
>> - folio_offset = ((index - folio->index) << PAGE_SHIFT) + offset;
>> + folio_offset = offset_in_folio(folio, outarg.offset);
>
> offset is a loop variable, and later offset maybe set to 0. Replacing it
> with outarg.offset here would change the behavior. The same below.
> Will this cause any problems?
>
> Thanks,
> Chunsheng Luo
>
>> nr_bytes = min_t(unsigned, num, folio_size(folio) - folio_offset);
>> nr_pages = DIV_ROUND_UP(offset + nr_bytes, PAGE_SIZE);
>> @@ -1916,7 +1916,7 @@ static int fuse_retrieve(struct fuse_mount *fm, struct inode *inode,
>> if (IS_ERR(folio))
>> break;
>> - folio_offset = ((index - folio->index) << PAGE_SHIFT) + offset;
>> + folio_offset = offset_in_folio(folio, outarg->offset);
>> nr_bytes = min(folio_size(folio) - folio_offset, num);
>> nr_pages = DIV_ROUND_UP(offset + nr_bytes, PAGE_SIZE);
>>
>
>
>
Powered by blists - more mailing lists