diff options
| author | David S. Miller <davem@davemloft.net> | 2009-02-18 00:24:05 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-02-18 00:24:05 -0500 |
| commit | 92a0acce186cde8ead56c6915d9479773673ea1a (patch) | |
| tree | 97b7663f77f8274cb52d429c8a7db97c70daf745 /include | |
| parent | 34edaa88324004baf4884fb0388f86059d9c4878 (diff) | |
net: Kill skb_truesize_check(), it only catches false-positives.
A long time ago we had bugs, primarily in TCP, where we would modify
skb->truesize (for TSO queue collapsing) in ways which would corrupt
the socket memory accounting.
skb_truesize_check() was added in order to try and catch this error
more systematically.
However this debugging check has morphed into a Frankenstein of sorts
and these days it does nothing other than catch false-positives.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/skbuff.h | 9 | ||||
| -rw-r--r-- | include/net/sock.h | 1 |
2 files changed, 0 insertions, 10 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index cf2cb50f77d1..9dcf956ad18a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -416,15 +416,6 @@ extern void skb_over_panic(struct sk_buff *skb, int len, | |||
| 416 | void *here); | 416 | void *here); |
| 417 | extern void skb_under_panic(struct sk_buff *skb, int len, | 417 | extern void skb_under_panic(struct sk_buff *skb, int len, |
| 418 | void *here); | 418 | void *here); |
| 419 | extern void skb_truesize_bug(struct sk_buff *skb); | ||
| 420 | |||
| 421 | static inline void skb_truesize_check(struct sk_buff *skb) | ||
| 422 | { | ||
| 423 | int len = sizeof(struct sk_buff) + skb->len; | ||
| 424 | |||
| 425 | if (unlikely((int)skb->truesize < len)) | ||
| 426 | skb_truesize_bug(skb); | ||
| 427 | } | ||
| 428 | 419 | ||
| 429 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | 420 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, |
| 430 | int getfrag(void *from, char *to, int offset, | 421 | int getfrag(void *from, char *to, int offset, |
diff --git a/include/net/sock.h b/include/net/sock.h index ce3b5b622683..eefeeaf7fc46 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -860,7 +860,6 @@ static inline void sk_mem_uncharge(struct sock *sk, int size) | |||
| 860 | 860 | ||
| 861 | static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) | 861 | static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) |
| 862 | { | 862 | { |
| 863 | skb_truesize_check(skb); | ||
| 864 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); | 863 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); |
| 865 | sk->sk_wmem_queued -= skb->truesize; | 864 | sk->sk_wmem_queued -= skb->truesize; |
| 866 | sk_mem_uncharge(sk, skb->truesize); | 865 | sk_mem_uncharge(sk, skb->truesize); |
