Skip to content

Commit 6876214

Browse files
pietroborrellodavem330
authored andcommitted
rds: rds_rm_zerocopy_callback() correct order for list_add_tail()
rds_rm_zerocopy_callback() uses list_add_tail() with swapped arguments. This links the list head with the new entry, losing the references to the remaining part of the list. Fixes: 9426bbc ("rds: use list structure to track information for zerocopy completion notification") Suggested-by: Paolo Abeni <[email protected]> Signed-off-by: Pietro Borrello <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 75da437 commit 6876214

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/rds/message.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void rds_rm_zerocopy_callback(struct rds_sock *rs,
118118
ck = &info->zcookies;
119119
memset(ck, 0, sizeof(*ck));
120120
WARN_ON(!rds_zcookie_add(info, cookie));
121-
list_add_tail(&q->zcookie_head, &info->rs_zcookie_next);
121+
list_add_tail(&info->rs_zcookie_next, &q->zcookie_head);
122122

123123
spin_unlock_irqrestore(&q->lock, flags);
124124
/* caller invokes rds_wake_sk_sleep() */

0 commit comments

Comments
 (0)