From: Herbert Xu <[EMAIL PROTECTED]> Date: Tue, 11 Jul 2006 21:45:44 +1000
> [IPCOMP]: Fix truesize after decompression > > The truesize check has uncovered the fact that we forgot to update truesize > after pskb_expand_head. Unfortunately pskb_expand_head can't update it for > us because it's used in all sorts of different contexts, some of which would > not allow truesize to be updated by itself. > > So the solution for now is to simply update it in IPComp. > > This patch also changes skb_put to __skb_put since we've just expanded > tailroom by exactly that amount so we know it's there (but gcc does not). > > Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Applied. I think it is possible cover a certain class of these situations from within pskb_expand_head. For example, if skb->sk is NULL we can prove that updating skb->truesize is safe since no socket's buffer accounting can possible depend upon the truesize value of this skb. That way, we don't need to dilly-dally around spotting all the cases like these two decompression bits where we need to add the truesize adjustment by-hand. This got me thinking... we can probably handle the skb->sk != NULL case with some minor surgery. If we could give some more information to the skb->destructor callback, it could be used for truesize adjustments. The only remaining issue is context within which the destructor is called for truesize changes. There are some messy assumptions out that, such as sk_stream_rfree(), which work on the basis that the SKB is always freed up from the socket code with the socket locked. They use this assumption in order to safely be able to adjust sk->sk_forward_alloc without any explicit locking. So it gets a little messy, but I think it's doable in the end. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html