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: <20130425101249.GA16770@gmail.com>
Date:	Thu, 25 Apr 2013 18:12:49 +0800
From:	Zheng Liu <gnehzuil.liu@...il.com>
To:	linux-ext4@...r.kernel.org, Jan Kara <jack@...e.cz>
Cc:	Zheng Liu <wenqing.lz@...bao.com>
Subject: Re: [PATCH] jbd: use kmem_cache_zalloc instead of
 kmem_cache_alloc/memset

On Fri, Apr 12, 2013 at 08:24:06PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@...bao.com>
> 
> Now jbd_alloc_handle is only called by new_handle.  So this commit
> uses kmem_cache_zalloc instead of kmem_cache_alloc/memset.
> 
> Signed-off-by: Zheng Liu <wenqing.lz@...bao.com>

Hi Jan,

Sorry, I forgot to Cc you.  Could you please take a look at this patch?

Thanks,
                                                - Zheng

> ---
>  fs/jbd/transaction.c | 1 -
>  include/linux/jbd.h  | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
> index 071d690..e3e255c 100644
> --- a/fs/jbd/transaction.c
> +++ b/fs/jbd/transaction.c
> @@ -245,7 +245,6 @@ static handle_t *new_handle(int nblocks)
>  	handle_t *handle = jbd_alloc_handle(GFP_NOFS);
>  	if (!handle)
>  		return NULL;
> -	memset(handle, 0, sizeof(*handle));
>  	handle->h_buffer_credits = nblocks;
>  	handle->h_ref = 1;
>  
> diff --git a/include/linux/jbd.h b/include/linux/jbd.h
> index c8f3297..7e0b622 100644
> --- a/include/linux/jbd.h
> +++ b/include/linux/jbd.h
> @@ -887,7 +887,7 @@ extern struct kmem_cache *jbd_handle_cache;
>  
>  static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags)
>  {
> -	return kmem_cache_alloc(jbd_handle_cache, gfp_flags);
> +	return kmem_cache_zalloc(jbd_handle_cache, gfp_flags);
>  }
>  
>  static inline void jbd_free_handle(handle_t *handle)
> -- 
> 1.7.12.rc2.18.g61b472e
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ