* [PATCH net-next v2] rds: rds_rm_zerocopy_callback() use list_first_entry()
@ 2023-02-07 14:57 Pietro Borrello
2023-02-07 18:20 ` Willem de Bruijn
0 siblings, 1 reply; 3+ messages in thread
From: Pietro Borrello @ 2023-02-07 14:57 UTC (permalink / raw)
To: Santosh Shilimkar, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Willem de Bruijn
Cc: Cristiano Giuffrida, Bos, H.J.,
Jakob Koschel, netdev, linux-rdma, rds-devel, linux-kernel,
Pietro Borrello
rds_rm_zerocopy_callback() uses list_entry() on the head of a list
causing a type confusion.
Use list_first_entry() to actually access the first element of the
rs_zcookie_queue list.
Fixes: 9426bbc6de99 ("rds: use list structure to track information for zerocopy completion notification")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
---
net/rds/message.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/rds/message.c b/net/rds/message.c
index b47e4f0a1639..c19c93561227 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -104,9 +104,9 @@ static void rds_rm_zerocopy_callback(struct rds_sock *rs,
spin_lock_irqsave(&q->lock, flags);
head = &q->zcookie_head;
if (!list_empty(head)) {
- info = list_entry(head, struct rds_msg_zcopy_info,
- rs_zcookie_next);
- if (info && rds_zcookie_add(info, cookie)) {
+ info = list_first_entry(head, struct rds_msg_zcopy_info,
+ rs_zcookie_next);
+ if (rds_zcookie_add(info, cookie)) {
spin_unlock_irqrestore(&q->lock, flags);
kfree(rds_info_from_znotifier(znotif));
/* caller invokes rds_wake_sk_sleep() */
---
base-commit: 6d796c50f84ca79f1722bb131799e5a5710c4700
change-id: 20230202-rds-zerocopy-be99b84131c8
Best regards,
--
Pietro Borrello <borrello@diag.uniroma1.it>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] rds: rds_rm_zerocopy_callback() use list_first_entry()
2023-02-07 14:57 [PATCH net-next v2] rds: rds_rm_zerocopy_callback() use list_first_entry() Pietro Borrello
@ 2023-02-07 18:20 ` Willem de Bruijn
2023-02-07 18:27 ` Pietro Borrello
0 siblings, 1 reply; 3+ messages in thread
From: Willem de Bruijn @ 2023-02-07 18:20 UTC (permalink / raw)
To: Pietro Borrello
Cc: Santosh Shilimkar, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Cristiano Giuffrida, Bos, H.J.,
Jakob Koschel, netdev, linux-rdma, rds-devel, linux-kernel,
sowmini.varadhan
On Tue, Feb 7, 2023 at 9:57 AM Pietro Borrello
<borrello@diag.uniroma1.it> wrote:
>
> rds_rm_zerocopy_callback() uses list_entry() on the head of a list
> causing a type confusion.
> Use list_first_entry() to actually access the first element of the
> rs_zcookie_queue list.
>
> Fixes: 9426bbc6de99 ("rds: use list structure to track information for zerocopy completion notification")
> Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
This should go to net.
Reviewed-by: Willem de Bruijn <willemb@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] rds: rds_rm_zerocopy_callback() use list_first_entry()
2023-02-07 18:20 ` Willem de Bruijn
@ 2023-02-07 18:27 ` Pietro Borrello
0 siblings, 0 replies; 3+ messages in thread
From: Pietro Borrello @ 2023-02-07 18:27 UTC (permalink / raw)
To: Willem de Bruijn
Cc: Santosh Shilimkar, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Cristiano Giuffrida, Bos, H.J.,
Jakob Koschel, netdev, linux-rdma, rds-devel, linux-kernel,
sowmini.varadhan
On Tue, 7 Feb 2023 at 19:21, Willem de Bruijn <willemb@google.com> wrote:
>
> On Tue, Feb 7, 2023 at 9:57 AM Pietro Borrello
> <borrello@diag.uniroma1.it> wrote:
> >
> > rds_rm_zerocopy_callback() uses list_entry() on the head of a list
> > causing a type confusion.
> > Use list_first_entry() to actually access the first element of the
> > rs_zcookie_queue list.
> >
> > Fixes: 9426bbc6de99 ("rds: use list structure to track information for zerocopy completion notification")
> > Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
>
> This should go to net.
Ops, fixed in v3
>
> Reviewed-by: Willem de Bruijn <willemb@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-07 18:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 14:57 [PATCH net-next v2] rds: rds_rm_zerocopy_callback() use list_first_entry() Pietro Borrello
2023-02-07 18:20 ` Willem de Bruijn
2023-02-07 18:27 ` Pietro Borrello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).