lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 17 Nov 2022 12:24:40 +0800
From:   Jingbo Xu <jefflexu@...ux.alibaba.com>
To:     David Howells <dhowells@...hat.com>,
        Jeff Layton <jlayton@...nel.org>
Cc:     xiang@...nel.org, chao@...nel.org, linux-erofs@...ts.ozlabs.org,
        linux-cachefs@...hat.com, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] fscache,cachefiles: add prepare_ondemand_read()
 callback



On 11/16/22 9:41 PM, David Howells wrote:
> Jeff Layton <jlayton@...nel.org> wrote:
> 
>>> +static enum netfs_io_source cachefiles_do_prepare_read(struct netfs_cache_resources *cres,
>>> +					loff_t *_start, size_t *_len,
>>> +					unsigned long *_flags, loff_t i_size)
>>
>> _start is never changed, so it should be passed by value instead of by
>> pointer.
> 
> Hmmm.  The intention was that the start pointer should be able to be moved
> backwards by the cache - but that's not necessary in ->prepare_read() and
> ->expand_readahead() is provided for that now.  So yes, the start pointer
> shouldn't get changed at this point.

Okay.


> 
>> I'd also reverse the position of the arguments for _flags and i_size.
>> Otherwise, the CPU/compiler have to shuffle things around more in
>> cachefiles_prepare_ondemand_read before they call this.
> 
> Better to pass the flags in and then ignore them.  That way it can tail call,
> or just call cachefiles_do_prepare_read() directly from erofs.  If you're
> going to have a wrapper, then you might be just as well create a
> netfs_io_subrequest struct on the stack.

I would prefer letting cachefiles_prepare_ondemand_read() pass flags in
and then tail call cachefiles_do_prepare_read() directly.

Many thanks for the suggestion.


-- 
Thanks,
Jingbo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ