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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210617150116.GG32587@quack2.suse.cz>
Date:   Thu, 17 Jun 2021 17:01:16 +0200
From:   Jan Kara <jack@...e.cz>
To:     Zhen Lei <thunder.leizhen@...wei.com>
Cc:     Jan Kara <jack@...e.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] quota: remove unnecessary oom message

On Thu 17-06-21 17:16:27, Zhen Lei wrote:
> Fixes scripts/checkpatch.pl warning:
> WARNING: Possible unnecessary 'out of memory' message
> 
> Remove it can help us save a bit of memory.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>

I agree the message is pointless. But when doing this, I guess we can just
get rid of getdqbuf() altogether and instead call kmalloc() directly in all
the places.

								Honza

> diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
> index c5562c871c8b..b097d02bad94 100644
> --- a/fs/quota/quota_tree.c
> +++ b/fs/quota/quota_tree.c
> @@ -49,11 +49,7 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
>  
>  static char *getdqbuf(size_t size)
>  {
> -	char *buf = kmalloc(size, GFP_NOFS);
> -	if (!buf)
> -		printk(KERN_WARNING
> -		       "VFS: Not enough memory for quota buffers.\n");
> -	return buf;
> +	return kmalloc(size, GFP_NOFS);
>  }
>  
>  static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
> -- 
> 2.25.1
> 
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ