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]
Message-ID: <48611a18-004f-7721-cc1f-104a5980b6cf@huaweicloud.com>
Date: Wed, 3 Jan 2024 09:27:29 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: Jan Kara <jack@...e.cz>
Cc: tytso@....edu, adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH 8/8] ext4: remove unnecessary parameter "needed" in
 ext4_discard_preallocations



on 1/2/2024 9:10 PM, Jan Kara wrote:
> On Sun 26-11-23 00:11:43, Kemeng Shi wrote:
>> The "needed" controls the number of ext4_prealloc_space to discard in
>> ext4_discard_preallocations. Function ext4_discard_preallocations is
>> supposed to discard all non-used preallocated blocks when "needed"
>> is 0 and now ext4_discard_preallocations is always called with "needed"
>> = 0. Remove unnecessary parameter "needed" and remove all non-used
>> preallocated spaces in ext4_discard_preallocations to simplify the
>> code.
>>
>> Note: If count of non-used preallocated spaces could be more than
>> UINT_MAX, there was a memory leak as some non-used preallocated
>> spaces are left unused and this commit will fix it. Otherwise,
>> there is no behavior change.
>>
>> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
> 
> Looks good, just one nit:
> 
>> @@ -5491,15 +5491,12 @@ void ext4_discard_preallocations(struct inode *inode, unsigned int needed)
>>  	mb_debug(sb, "discard preallocation for inode %lu\n",
>>  		 inode->i_ino);
>>  	trace_ext4_discard_preallocations(inode,
>> -			atomic_read(&ei->i_prealloc_active), needed);
>> -
>> -	if (needed == 0)
>> -		needed = UINT_MAX;
>> +			atomic_read(&ei->i_prealloc_active), 0);
> 
> There's no point in always returning 0 in the tracepoint so I'd just update
> it to not print the 'needed' value as well.
Thanks for review! Sure, 'needed' looks meaningless to the tracepoint. I
will remove it in next version.
> 
> 								Honza
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ