mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "cgel.zte@gmail.com" <cgel.zte@gmail.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"deng.changcheng@zte.com.cn" <deng.changcheng@zte.com.cn>,
	"anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"zealci@zte.com.cn" <zealci@zte.com.cn>
Subject: Re: [PATCH] NFS: Replace one-element array with flexible-array member
Date: Fri, 14 Jan 2022 03:59:26 +0000	[thread overview]
Message-ID: <ad9ebec6db5bac36e3b486288b84c4e1bbd781f2.camel@hammerspace.com> (raw)
In-Reply-To: <20220114005732.763911-1-deng.changcheng@zte.com.cn>

On Fri, 2022-01-14 at 00:57 +0000, cgel.zte@gmail.com wrote:
> From: Changcheng Deng <deng.changcheng@zte.com.cn>
> 
> There is a regular need in the kernel to provide a way to declare
> having
> a dynamically sized set of trailing elements in a structure. Kernel
> code
> should always use “flexible array members” for these cases. The older
> style of one-element or zero-length arrays should no longer be used.
> 
> Reference:
> https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length
> -
> and-one-element-arrays
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
> ---
>  include/linux/nfs_xdr.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
> index 39390d9df9e1..7f51edd5785a 100644
> --- a/include/linux/nfs_xdr.h
> +++ b/include/linux/nfs_xdr.h
> @@ -421,7 +421,7 @@ struct nfs42_layout_error {
>         __u64 offset;
>         __u64 length;
>         nfs4_stateid stateid;
> -       struct nfs42_device_error errors[1];
> +       struct nfs42_device_error errors[];
>  };
>  
>  #define NFS42_LAYOUTERROR_MAX 5

NACK. This is a fixed size array of length 1, not a variable size
array. Please fix your tool.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



      reply	other threads:[~2022-01-14  3:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14  0:57 cgel.zte
2022-01-14  3:59 ` Trond Myklebust [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad9ebec6db5bac36e3b486288b84c4e1bbd781f2.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=anna.schumaker@netapp.com \
    --cc=cgel.zte@gmail.com \
    --cc=deng.changcheng@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome