mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-14 06:56:49 +07:00
make skb_add_data,{_nocache}() and skb_copy_to_page_nocache() advance only on success
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
cbbd26b8b1
commit
15e6cb46c9
@ -2809,12 +2809,12 @@ static inline int skb_add_data(struct sk_buff *skb,
|
||||
|
||||
if (skb->ip_summed == CHECKSUM_NONE) {
|
||||
__wsum csum = 0;
|
||||
if (csum_and_copy_from_iter(skb_put(skb, copy), copy,
|
||||
&csum, from) == copy) {
|
||||
if (csum_and_copy_from_iter_full(skb_put(skb, copy), copy,
|
||||
&csum, from)) {
|
||||
skb->csum = csum_block_add(skb->csum, csum, off);
|
||||
return 0;
|
||||
}
|
||||
} else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy)
|
||||
} else if (copy_from_iter_full(skb_put(skb, copy), copy, from))
|
||||
return 0;
|
||||
|
||||
__skb_trim(skb, off);
|
||||
|
@ -1783,13 +1783,13 @@ static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
|
||||
{
|
||||
if (skb->ip_summed == CHECKSUM_NONE) {
|
||||
__wsum csum = 0;
|
||||
if (csum_and_copy_from_iter(to, copy, &csum, from) != copy)
|
||||
if (!csum_and_copy_from_iter_full(to, copy, &csum, from))
|
||||
return -EFAULT;
|
||||
skb->csum = csum_block_add(skb->csum, csum, offset);
|
||||
} else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) {
|
||||
if (copy_from_iter_nocache(to, copy, from) != copy)
|
||||
if (!copy_from_iter_full_nocache(to, copy, from))
|
||||
return -EFAULT;
|
||||
} else if (copy_from_iter(to, copy, from) != copy)
|
||||
} else if (!copy_from_iter_full(to, copy, from))
|
||||
return -EFAULT;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user