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: <5280bbc0-be8b-4e46-8410-28719cb79ef0@huawei.com>
Date: Wed, 5 Nov 2025 17:44:30 +0800
From: Baokun Li <libaokun1@...wei.com>
To: Jan Kara <jack@...e.cz>
CC: <linux-ext4@...r.kernel.org>, <tytso@....edu>, <adilger.kernel@...ger.ca>,
	<linux-kernel@...r.kernel.org>, <kernel@...kajraghav.com>,
	<mcgrof@...nel.org>, <linux-fsdevel@...r.kernel.org>, <linux-mm@...ck.org>,
	<yi.zhang@...wei.com>, <yangerkun@...wei.com>, <chengzhihao1@...wei.com>,
	<libaokun@...weicloud.com>, Baokun Li <libaokun1@...wei.com>
Subject: Re: [PATCH 12/25] ext4: support large block size in
 ext4_mb_get_buddy_page_lock()

On 2025-11-05 17:13, Jan Kara wrote:
> On Sat 25-10-25 11:22:08, libaokun@...weicloud.com wrote:
>> From: Baokun Li <libaokun1@...wei.com>
>>
>> Currently, ext4_mb_get_buddy_page_lock() uses blocks_per_page to calculate
>> folio index and offset. However, when blocksize is larger than PAGE_SIZE,
>> blocks_per_page becomes zero, leading to a potential division-by-zero bug.
>>
>> To support BS > PS, use bytes to compute folio index and offset within
>> folio to get rid of blocks_per_page.
>>
>> Also, since ext4_mb_get_buddy_page_lock() already fully supports folio,
>> rename it to ext4_mb_get_buddy_folio_lock().
>>
>> Signed-off-by: Baokun Li <libaokun1@...wei.com>
>> Reviewed-by: Zhang Yi <yi.zhang@...wei.com>
> Looks good, just two typo fixes below. Feel free to add:
>
> Reviewed-by: Jan Kara <jack@...e.cz>
>
>> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
>> index 3494c6fe5bfb..d42d768a705a 100644
>> --- a/fs/ext4/mballoc.c
>> +++ b/fs/ext4/mballoc.c
>> @@ -1510,50 +1510,52 @@ static int ext4_mb_init_cache(struct folio *folio, char *incore, gfp_t gfp)
>>  }
>>  
> Let's fix some typos when updating the comment:

I’ll fix these typos in the next update.

Thank you for your review!


Regards,
Baokun

>
>>  /*
>> - * Lock the buddy and bitmap pages. This make sure other parallel init_group
>> - * on the same buddy page doesn't happen whild holding the buddy page lock.
>> - * Return locked buddy and bitmap pages on e4b struct. If buddy and bitmap
>> - * are on the same page e4b->bd_buddy_folio is NULL and return value is 0.
>> + * Lock the buddy and bitmap folios. This make sure other parallel init_group
> 					     ^^^ makes
>
>> + * on the same buddy folio doesn't happen whild holding the buddy folio lock.
> 					     ^^ while
>
>> + * Return locked buddy and bitmap folios on e4b struct. If buddy and bitmap
>> + * are on the same folio e4b->bd_buddy_folio is NULL and return value is 0.
>>   */
> 								Honza



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ