lkml.org 
[lkml]   [2023]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] fuse: enable larger read buffers for readdir [v2].
From
Hi,
>>>          plus = fuse_use_readdirplus(inode, ctx);
>>>          ap->args.out_pages = true;
>>> -       ap->num_pages = 1;
>>> +       ap->num_pages = READDIR_PAGES;
>>
>> No.  This is the array lenght, which is 1.  This is the hack I guess,
>> which makes the above trick work.
>
> Hmm, ap->num_pages / ap->pages[] is used in fuse_copy_pages, but so is
> ap->descs[] - shouldn't the patch caused an out-of-bound access?
> Out of interest, would you mind to explain how the hack worked?

Apparently it shouldn't ... my understanding of how pages* worked was
all wrong.

I'm guessing since all the data fits in the first page (ap->pages[0] in
other words, of length/size desc.length) that the other pages are never
accessed.  Looking at fuse_copy_pages this does indeed seem to be the
case.  So I ended up just being really, really lucky here.

Kind regards,
Jaco

\
 
 \ /
  Last update: 2023-07-28 07:06    [W:0.101 / U:1.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site