* [PATCH] nvme-tcp: memset scatterlist before sg_init_marker it
@ 2021-12-20 2:54 Jackie Liu
2021-12-20 10:42 ` Sagi Grimberg
2021-12-21 9:10 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Jackie Liu @ 2021-12-20 2:54 UTC (permalink / raw)
To: hch; +Cc: axboe, linux-nvme, liu.yun
From: Jackie Liu <liuyun01@kylinos.cn>
sg_init_marker's sg need initialized, otherwise report:
[...]
In file included from ../include/linux/dma-mapping.h:10,
from ../include/linux/skbuff.h:31,
from ../include/net/net_namespace.h:39,
from ../include/linux/netdevice.h:37,
from ../include/net/sock.h:46,
from ../drivers/nvme/host/tcp.c:12:
../drivers/nvme/host/tcp.c: In function ‘nvme_tcp_ddgst_update’:
../include/linux/scatterlist.h:214:16: error: ‘sg.page_link’ is used uninitialized in this function [-Werror=uninitialized]
214 | sg->page_link |= SG_END;
| ^~
cc1: all warnings being treated as errors
make[4]: *** [../scripts/Makefile.build:287: drivers/nvme/host/tcp.o] Error 1
make[3]: *** [../scripts/Makefile.build:549: drivers/nvme/host] Error 2
make[2]: *** [../scripts/Makefile.build:549: drivers/nvme] Error 2
make[2]: *** Waiting for unfinished jobs....
[...]
Reported-by: k2ci <kernel-bot@kylinos.cn>
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
drivers/nvme/host/tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 4ceb28675fdf..8fd8cbe23683 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -348,7 +348,7 @@ static inline void nvme_tcp_ddgst_update(struct ahash_request *hash,
{
struct scatterlist sg;
- sg_init_marker(&sg, 1);
+ sg_init_table(&sg, 1);
sg_set_page(&sg, page, len, off);
ahash_request_set_crypt(hash, &sg, NULL, len);
crypto_ahash_update(hash);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme-tcp: memset scatterlist before sg_init_marker it
2021-12-20 2:54 [PATCH] nvme-tcp: memset scatterlist before sg_init_marker it Jackie Liu
@ 2021-12-20 10:42 ` Sagi Grimberg
2021-12-21 9:10 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2021-12-20 10:42 UTC (permalink / raw)
To: Jackie Liu, hch; +Cc: axboe, linux-nvme
On 12/20/21 4:54 AM, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
>
> sg_init_marker's sg need initialized, otherwise report:
>
> [...]
> In file included from ../include/linux/dma-mapping.h:10,
> from ../include/linux/skbuff.h:31,
> from ../include/net/net_namespace.h:39,
> from ../include/linux/netdevice.h:37,
> from ../include/net/sock.h:46,
> from ../drivers/nvme/host/tcp.c:12:
> ../drivers/nvme/host/tcp.c: In function ‘nvme_tcp_ddgst_update’:
> ../include/linux/scatterlist.h:214:16: error: ‘sg.page_link’ is used uninitialized in this function [-Werror=uninitialized]
> 214 | sg->page_link |= SG_END;
> | ^~
> cc1: all warnings being treated as errors
> make[4]: *** [../scripts/Makefile.build:287: drivers/nvme/host/tcp.o] Error 1
> make[3]: *** [../scripts/Makefile.build:549: drivers/nvme/host] Error 2
> make[2]: *** [../scripts/Makefile.build:549: drivers/nvme] Error 2
> make[2]: *** Waiting for unfinished jobs....
> [...]
This needs:
Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver")
>
> Reported-by: k2ci <kernel-bot@kylinos.cn>
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
> ---
> drivers/nvme/host/tcp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index 4ceb28675fdf..8fd8cbe23683 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -348,7 +348,7 @@ static inline void nvme_tcp_ddgst_update(struct ahash_request *hash,
> {
> struct scatterlist sg;
>
> - sg_init_marker(&sg, 1);
> + sg_init_table(&sg, 1);
> sg_set_page(&sg, page, len, off);
> ahash_request_set_crypt(hash, &sg, NULL, len);
> crypto_ahash_update(hash);
>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme-tcp: memset scatterlist before sg_init_marker it
2021-12-20 2:54 [PATCH] nvme-tcp: memset scatterlist before sg_init_marker it Jackie Liu
2021-12-20 10:42 ` Sagi Grimberg
@ 2021-12-21 9:10 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-12-21 9:10 UTC (permalink / raw)
To: Jackie Liu; +Cc: hch, axboe, linux-nvme
Thanks,
applied to nvme-5.16 (with the fixes tag).
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-21 9:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 2:54 [PATCH] nvme-tcp: memset scatterlist before sg_init_marker it Jackie Liu
2021-12-20 10:42 ` Sagi Grimberg
2021-12-21 9:10 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.