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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <tw4rtosj3jcu73u4eggg7ygh2fstsg5xr774ep2gr2lsnac4md@szuihm2uoafh>
Date: Thu, 23 Oct 2025 00:29:11 +0800
From: "Coly Li" <colyli@...as.com>
To: "tanze" <tanze@...inos.cn>
Cc: <kent.overstreet@...ux.dev>, <john.g.garry@...cle.com>, 
	<linux-kernel@...r.kernel.org>, <linux-bcache@...r.kernel.org>
Subject: Re: [PATCH v1] bcache: Use vmalloc_array() to improve code

On Wed, Oct 22, 2025 at 10:24:36PM +0800, tanze wrote:
> 
> 在 2025/10/22 20:03, Coly Li 写道:
> > On Fri, Oct 17, 2025 at 07:13:06PM +0800, tanze wrote:
> > > Remove array_size() calls and replace vmalloc(), Due to vmalloc_array() is optimized better,
> > > uses fewer instructions, and handles overflow more concisely[1].
> > > 
> > > Signed-off-by: tanze<tanze@...inos.cn>
> > > ---
> > >   drivers/md/bcache/sysfs.c | 3 +--
> > >   1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
> > > index 826b14cae4e5..dc568e8eb6eb 100644
> > > --- a/drivers/md/bcache/sysfs.c
> > > +++ b/drivers/md/bcache/sysfs.c
> > > @@ -1061,8 +1061,7 @@ SHOW(__bch_cache)
> > >   		uint16_t q[31], *p, *cached;
> > >   		ssize_t ret;
> > > -		cached = p = vmalloc(array_size(sizeof(uint16_t),
> > > -						ca->sb.nbuckets));
> > > +		cached = p = vmalloc_array(ca->sb.nbuckets,sizeof(uint16_t));
> >                                                            ^^^-> a blank missing?
> Thank you for your correction. If you need me to revise these descriptions,
> I will send the version 2 (v2) patch later

Yes, version 2 will be fine.

> > >   		if (!p)
> > >   			return -ENOMEM;
> > Except for the missing blank, overall the patch is fine.
> > 
> > BTW, IMHO tanze is not a formal method to spell the name, could you please
> > use a formal format? It will be helpful to identify your contribution in
> > future.
> 
> Hi , Coly Li.
> Thank you for your reply. First of all, I am Chinese. I often use this name
> as
> my signature on many occasions, and I also used this name for the code
> submitted
> to the upstream party before.

Okey, then ignore my noise.

Thanks.

Coly Li

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ