Skip to content

Commit a41bd25

Browse files
Paolo Abenitrondmypd
authored andcommitted
sunrpc: fix UDP memory accounting
The commit f9b2ee7 ("SUNRPC: Move UDP receive data path into a workqueue context"), as a side effect, moved the skb_free_datagram() call outside the scope of the related socket lock, but UDP sockets require such lock to be held for proper memory accounting. Fix it by replacing skb_free_datagram() with skb_free_datagram_locked(). Fixes: f9b2ee7 ("SUNRPC: Move UDP receive data path into a workqueue context") Reported-and-tested-by: Jan Stancek <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Cc: [email protected] # 4.4+ Signed-off-by: Trond Myklebust <[email protected]>
1 parent 98b0f80 commit a41bd25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/xprtsock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ static void xs_udp_data_receive(struct sock_xprt *transport)
10741074
skb = skb_recv_datagram(sk, 0, 1, &err);
10751075
if (skb != NULL) {
10761076
xs_udp_data_read_skb(&transport->xprt, sk, skb);
1077-
skb_free_datagram(sk, skb);
1077+
skb_free_datagram_locked(sk, skb);
10781078
continue;
10791079
}
10801080
if (!test_and_clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state))

0 commit comments

Comments
 (0)