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: <7k7og24ts2sfulbqni7dtosknr5nng4p6l5zfu4mrbyoqfd6mz@wfslwlrlcaux>
Date: Tue, 29 Apr 2025 11:54:51 +0200
From: Jan Kara <jack@...e.cz>
To: alexjlzheng@...il.com
Cc: viro@...iv.linux.org.uk, brauner@...nel.org, jack@...e.cz, 
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Jinliang Zheng <alexjlzheng@...cent.com>
Subject: Re: [PATCH] fs: remove useless plus one in super_cache_scan()

On Mon 28-04-25 21:50:50, alexjlzheng@...il.com wrote:
> From: Jinliang Zheng <alexjlzheng@...cent.com>
> 
> After commit 475d0db742e3 ("fs: Fix theoretical division by 0 in
> super_cache_scan()."), there's no need to plus one to prevent
> division by zero.
> 
> Remove it to simplify the code.
> 
> Signed-off-by: Jinliang Zheng <alexjlzheng@...cent.com>

Fair enough. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/super.c b/fs/super.c
> index 97a17f9d9023..6bbdb7e59a8d 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -201,7 +201,7 @@ static unsigned long super_cache_scan(struct shrinker *shrink,
>  
>  	inodes = list_lru_shrink_count(&sb->s_inode_lru, sc);
>  	dentries = list_lru_shrink_count(&sb->s_dentry_lru, sc);
> -	total_objects = dentries + inodes + fs_objects + 1;
> +	total_objects = dentries + inodes + fs_objects;
>  	if (!total_objects)
>  		total_objects = 1;
>  
> -- 
> 2.49.0
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ