direct-io.hg

changeset 5212:caf47ecec89d

bitkeeper revision 1.1159.258.156 (429ba4d3T2WmSlhY2aTmV6KN88hZHw)

Solve badness problem when udp_poll() receives fragmented skbuff w/ CONFIG_HIGHMEM
Upstream patch (now in -net tree) from Herbert Xu.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steven Hand <steven@xensource.com>
author smh22@tempest.cl.cam.ac.uk
date Mon May 30 23:42:11 2005 +0000 (2005-05-30)
parents 254dc1cf9be7
children 0c6cce9d9b82 eef4852dd799
files .rootkeys patches/linux-2.6.11/udp-frag.patch
line diff
     1.1 --- a/.rootkeys	Mon May 30 20:35:36 2005 +0000
     1.2 +++ b/.rootkeys	Mon May 30 23:42:11 2005 +0000
     1.3 @@ -370,6 +370,7 @@ 42372652KCUP-IOH9RN19YQmGhs4aA patches/l
     1.4  428359d4b3fDYtazwXi4UUmSWaOUew patches/linux-2.6.11/linux-2.6.11.11.patch
     1.5  418abc69J3F638vPO9MYoDGeYilxoQ patches/linux-2.6.11/nettel.patch
     1.6  429ae875I9ZrqrRDjGD34IC2kzDREw patches/linux-2.6.11/rcu-nohz.patch
     1.7 +429ba3007184K-y6WHQ6KgY65-lEIQ patches/linux-2.6.11/udp-frag.patch
     1.8  3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Makefile
     1.9  40e1b09db5mN69Ijj0X_Eol-S7dXiw tools/Rules.mk
    1.10  4124b307nRyK3dhn1hAsvrY76NuV3g tools/check/Makefile
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/linux-2.6.11/udp-frag.patch	Mon May 30 23:42:11 2005 +0000
     2.3 @@ -0,0 +1,55 @@
     2.4 +diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
     2.5 +--- a/net/ipv4/udp.c
     2.6 ++++ b/net/ipv4/udp.c
     2.7 +@@ -738,7 +738,7 @@ int udp_ioctl(struct sock *sk, int cmd, 
     2.8 + 			unsigned long amount;
     2.9 + 
    2.10 + 			amount = 0;
    2.11 +-			spin_lock_irq(&sk->sk_receive_queue.lock);
    2.12 ++			spin_lock_bh(&sk->sk_receive_queue.lock);
    2.13 + 			skb = skb_peek(&sk->sk_receive_queue);
    2.14 + 			if (skb != NULL) {
    2.15 + 				/*
    2.16 +@@ -748,7 +748,7 @@ int udp_ioctl(struct sock *sk, int cmd, 
    2.17 + 				 */
    2.18 + 				amount = skb->len - sizeof(struct udphdr);
    2.19 + 			}
    2.20 +-			spin_unlock_irq(&sk->sk_receive_queue.lock);
    2.21 ++			spin_unlock_bh(&sk->sk_receive_queue.lock);
    2.22 + 			return put_user(amount, (int __user *)arg);
    2.23 + 		}
    2.24 + 
    2.25 +@@ -848,12 +848,12 @@ csum_copy_err:
    2.26 + 	/* Clear queue. */
    2.27 + 	if (flags&MSG_PEEK) {
    2.28 + 		int clear = 0;
    2.29 +-		spin_lock_irq(&sk->sk_receive_queue.lock);
    2.30 ++		spin_lock_bh(&sk->sk_receive_queue.lock);
    2.31 + 		if (skb == skb_peek(&sk->sk_receive_queue)) {
    2.32 + 			__skb_unlink(skb, &sk->sk_receive_queue);
    2.33 + 			clear = 1;
    2.34 + 		}
    2.35 +-		spin_unlock_irq(&sk->sk_receive_queue.lock);
    2.36 ++		spin_unlock_bh(&sk->sk_receive_queue.lock);
    2.37 + 		if (clear)
    2.38 + 			kfree_skb(skb);
    2.39 + 	}
    2.40 +@@ -1334,7 +1334,7 @@ unsigned int udp_poll(struct file *file,
    2.41 + 		struct sk_buff_head *rcvq = &sk->sk_receive_queue;
    2.42 + 		struct sk_buff *skb;
    2.43 + 
    2.44 +-		spin_lock_irq(&rcvq->lock);
    2.45 ++		spin_lock_bh(&rcvq->lock);
    2.46 + 		while ((skb = skb_peek(rcvq)) != NULL) {
    2.47 + 			if (udp_checksum_complete(skb)) {
    2.48 + 				UDP_INC_STATS_BH(UDP_MIB_INERRORS);
    2.49 +@@ -1345,7 +1345,7 @@ unsigned int udp_poll(struct file *file,
    2.50 + 				break;
    2.51 + 			}
    2.52 + 		}
    2.53 +-		spin_unlock_irq(&rcvq->lock);
    2.54 ++		spin_unlock_bh(&rcvq->lock);
    2.55 + 
    2.56 + 		/* nothing to see, move along */
    2.57 + 		if (skb == NULL)
    2.58 +