From: Nam Cao <namcaov@gmail.com>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
"sagi@grimberg.me" <sagi@grimberg.me>, "hch@lst.de" <hch@lst.de>,
"axboe@fb.com" <axboe@fb.com>,
"kbusch@kernel.org" <kbusch@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] nvme-tcp: replace sg_init_marker() with sg_init_table()
Date: Tue, 25 Oct 2022 11:30:16 +0200 [thread overview]
Message-ID: <20221025092737.GA254308@nam-dell> (raw)
In-Reply-To: <810f1de0-769c-ce67-4ec6-007ce25acfe0@nvidia.com>
On Tue, Oct 25, 2022 at 12:58:41AM +0000, Chaitanya Kulkarni wrote:
> On 10/22/22 10:46, Nam Cao wrote:
> > In nvme_tcp_ddgst_update(), sg_init_marker() is called with an
> > uninitialized scatterlist. This is probably fine, but gcc complains:
> >
> > CC [M] drivers/nvme/host/tcp.o
> > In file included from ./include/linux/dma-mapping.h:10,
> > from ./include/linux/skbuff.h:31,
> > from ./include/net/net_namespace.h:43,
> > from ./include/linux/netdevice.h:38,
> > from ./include/net/sock.h:46,
> > from drivers/nvme/host/tcp.c:12:
> > In function ‘sg_mark_end’,
> > inlined from ‘sg_init_marker’ at ./include/linux/scatterlist.h:356:2,
> > inlined from ‘nvme_tcp_ddgst_update’ at drivers/nvme/host/tcp.c:390:2:
> > ./include/linux/scatterlist.h:234:11: error: ‘sg.page_link’ is used uninitialized [-Werror=uninitialized]
> > 234 | sg->page_link |= SG_END;
> > | ~~^~~~~~~~~~~
> > drivers/nvme/host/tcp.c: In function ‘nvme_tcp_ddgst_update’:
> > drivers/nvme/host/tcp.c:388:28: note: ‘sg’ declared here
> > 388 | struct scatterlist sg;
> > | ^~
> > cc1: all warnings being treated as errors
> >
> > Use sg_init_table() instead, which basically memset the scatterlist to
> > zero first before calling sg_init_marker().
> >
> > Signed-off-by: Nam Cao <namcaov@gmail.com>
>
> Looks good to me, can you please share what version if gcc you are
> using ? my test setup did not catch this error and I'd like to update
> with the one that can catch these errors.
It was just gcc12. But strange enough I cannot trigger this error again.
I was doing randconfig test build. Probably only a specific combination
of configs that can allow gcc to detect this...
And sorry but I was just start doing randconfig test and didn't think
about saving that .config file.
Best regards,
Nam
next prev parent reply other threads:[~2022-10-25 9:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-22 17:46 [PATCH] nvme-tcp: replace sg_init_marker() with sg_init_table() Nam Cao
2022-10-23 7:48 ` Sagi Grimberg
2022-10-25 0:58 ` Chaitanya Kulkarni
2022-10-25 9:30 ` Nam Cao [this message]
2022-10-25 15:10 ` Christoph Hellwig
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=20221025092737.GA254308@nam-dell \
--to=namcaov@gmail.com \
--cc=axboe@fb.com \
--cc=chaitanyak@nvidia.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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