Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1363157

Re: [PATCH] Revert "Staging: lustre: o2iblnd: Use sizeof type *pointer instead of sizeof type."

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] Revert "Staging: lustre: o2iblnd: Use sizeof type *pointer instead of sizeof type."
Date 2016-03-23 02:50 +0100
Message-ID <rfG5P-4yd-1@gated-at.bofh.it> (permalink)
References <rfCYh-2xh-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Mar 22, 2016 at 06:21:04PM -0400, James Simmons wrote:
> Latest testing fails when using ko2iblnd. It was tracked down
> to commit 4671a026616df26000f7d8ad2f2ea4b6de79263c.
> 
> This reverts commit 4671a026616df26000f7d8ad2f2ea4b6de79263c.
> ---
>  .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c    |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
> index 89f9390..0d32e65 100644
> --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
> +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
> @@ -1968,7 +1968,7 @@ static int kiblnd_net_init_pools(kib_net_t *net, __u32 *cpts, int ncpts)
>  	 */
>  
>  	net->ibn_fmr_ps = cfs_percpt_alloc(lnet_cpt_table(),
> -					   sizeof(*net->ibn_fmr_ps));
> +					   sizeof(kib_fmr_poolset_t));

Ok, why is this revert needed?  Please give me a big huge comment about
why this is not the same size of the variable being assigned to it,
otherwise someone else is going to come along and make the exact same
change again.

>  	if (!net->ibn_fmr_ps) {
>  		CERROR("Failed to allocate FMR pool array\n");
>  		rc = -ENOMEM;
> @@ -1992,7 +1992,7 @@ static int kiblnd_net_init_pools(kib_net_t *net, __u32 *cpts, int ncpts)
>  
>   create_tx_pool:
>  	net->ibn_tx_ps = cfs_percpt_alloc(lnet_cpt_table(),
> -					  sizeof(*net->ibn_tx_ps));
> +					  sizeof(kib_tx_poolset_t));

Same here, why is this code wrong?

thanks,

greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Revert "Staging: lustre: o2iblnd: Use sizeof type *pointer instead of sizeof type." James Simmons <jsimmons@infradead.org> - 2016-03-22 23:30 +0100
  Re: [PATCH] Revert "Staging: lustre: o2iblnd: Use sizeof type  *pointer instead of sizeof type." Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-23 02:50 +0100
    Re: [lustre-devel] [PATCH] Revert "Staging: lustre: o2iblnd: Use  sizeof type *pointer instead of sizeof type." "Dilger, Andreas" <andreas.dilger@intel.com> - 2016-03-23 06:50 +0100
      Re: [lustre-devel] [PATCH] Revert "Staging: lustre: o2iblnd: Use  sizeof type *pointer instead of sizeof type." "Oucharek, Doug S" <doug.s.oucharek@intel.com> - 2016-03-23 07:40 +0100
      Re: [lustre-devel] [PATCH] Revert "Staging: lustre: o2iblnd: Use  sizeof type *pointer instead of sizeof type." Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-23 14:50 +0100
        RE: [lustre-devel] [PATCH] Revert "Staging: lustre: o2iblnd: Use  sizeof type *pointer instead of sizeof type." "Simmons, James A." <simmonsja@ornl.gov> - 2016-03-23 19:40 +0100
          Re: [lustre-devel] [PATCH] Revert "Staging: lustre: o2iblnd: Use  sizeof type *pointer instead of sizeof type." Joe Perches <joe@perches.com> - 2016-03-23 19:50 +0100
            RE: [lustre-devel] [PATCH] Revert "Staging: lustre: o2iblnd: Use  sizeof type *pointer instead of sizeof type." "Simmons, James A." <simmonsja@ornl.gov> - 2016-03-23 21:40 +0100
              Re: [lustre-devel] [PATCH] Revert "Staging: lustre: o2iblnd: Use  sizeof type *pointer instead of sizeof type." 'Greg Kroah-Hartman' <gregkh@linuxfoundation.org> - 2016-03-23 21:50 +0100

csiph-web