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] [thread-next>] [day] [month] [year] [list]
Message-ID: <801cac51-1bd3-4f79-8474-251a7a81ca08@intel.com>
Date: Fri, 5 Jul 2024 14:02:22 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Minchan Kim
	<minchan@...nel.org>, Sergey Senozhatsky <senozhatsky@...omium.org>, "Jens
 Axboe" <axboe@...nel.dk>, Thomas Gleixner <tglx@...utronix.de>, "Mike
 Galbraith" <umgwanakikbuti@...il.com>
Subject: Re: [PATCH v2 1/3] zram: Replace bit spinlocks with a spinlock_t.

From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Date: Thu, 4 Jul 2024 14:19:08 +0200

> On 2024-07-04 13:38:04 [+0200], Alexander Lobakin wrote:
>>> index 3acd7006ad2cc..036845cd4f25e 100644
>>> --- a/drivers/block/zram/zram_drv.c
>>> +++ b/drivers/block/zram/zram_drv.c
>>> @@ -57,19 +57,34 @@ static void zram_free_page(struct zram *zram, size_t index);
>>>  static int zram_read_page(struct zram *zram, struct page *page, u32 index,
>>>  			  struct bio *parent);
>>>  
>>> +static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages)
>>> +{
>>> +	size_t index;
>>> +
>>> +	for (index = 0; index < num_pages; index++)
>>
>> Maybe declare @index right here?
> 
> But why? Declarations at the top followed by code. 

I meant

	for (size_t index = 0; index < num_pages; index++)

It's allowed and even recommended for a couple years already.

> 
>>
>>> +		spin_lock_init(&zram->table[index].lock);
>>> +}
>>
>> [...]
>>
>> Thanks,
>> Olek
> 
> Sebastian

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ