]> git.neil.brown.name Git - history.git/commitdiff
Import 1.0.1 1.0.1
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:09:24 +0000 (15:09 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:09:24 +0000 (15:09 -0500)
12 files changed:
CREDITS
Makefile
drivers/FPU-emu/fpu_entry.c
drivers/char/lp.c
drivers/net/8390.c
fs/select.c
mm/kmalloc.c
mm/swap.c
net/inet/dev.c
net/inet/ip.c
net/inet/skbuff.c
net/inet/tcp.c

diff --git a/CREDITS b/CREDITS
index dfe611876b7363f50488e4815bc14c1d772a1058..11c0c64c1ff25ae93d343e5867efc7b9ac209cdb 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -390,7 +390,7 @@ S: D-37083 Goettingen
 S: Germany
 
 N: Ian A. Murdock
-E: imurdock@shell.portal.com
+E: imurdock@gnu.ai.mit.edu
 D: Creator of Debian distribution
 S: 30 White Tail Lane
 S: Lafayette, Indiana 47906
index be8194bb4d14da438e6d208e210eb9166de78b0f..586f706896b2fb3f89244f48ea6cf5ab01b55409 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 0
-ALPHA =
+SUBLEVEL = 1
 
 all:   Version zImage
 
@@ -128,7 +128,7 @@ tools/./version.h: tools/version.h
 
 tools/version.h: $(CONFIGURE) Makefile
        @./makever.sh
-       @echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL)$(ALPHA)\" > tools/version.h
+       @echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)\" > tools/version.h
        @echo \#define UTS_VERSION \"\#`cat .version` `date`\" >> tools/version.h
        @echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h
        @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h
index a06183c06154f3775efffb2b114d8fb228c15e4e..57751320b47f48212cd2edaf998039598c816643 100644 (file)
@@ -279,6 +279,8 @@ do_another_FPU_instruction:
              }
          }
 
+         FPU_EIP = FPU_ORIG_EIP;       /* Point to current FPU instruction. */
+
          RE_ENTRANT_CHECK_OFF;
          current->tss.trap_no = 16;
          current->tss.error_code = 0;
index ec4029758aedaaeff2e3088e92cc6186b863fa7e..a361bab12ff5e80042f972488f56ef2407c6c9fd 100644 (file)
@@ -170,6 +170,7 @@ static int lp_write_interrupt(struct inode * inode, struct file * file, char * b
                                current->timeout = jiffies + LP_TIMEOUT_INTERRUPT;
                                interruptible_sleep_on(&lp->lp_wait_q);
                                outb_p((LP_PSELECP|LP_PINITP), (LP_C(minor)));
+                               sti();
                                if (current->signal & ~current->blocked) {
                                        if (total_bytes_written + bytes_written)
                                                return total_bytes_written + bytes_written;
index e2125afc5a9c5817e145219f63f8c109035c43d6..adc62503fd470ed96f9d7b87bb34af8e91517f75 100644 (file)
@@ -145,14 +145,14 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
                        return 1;
                }
                isr = inb(e8390_base+EN0_ISR);
-               printk("%s: transmit timed out, TX status %#2x, ISR %#2x.\n",
+               printk(KERN_DEBUG "%s: transmit timed out, TX status %#2x, ISR %#2x.\n",
                           dev->name, txsr, isr);
                /* Does the 8390 thinks it has posted an interrupt? */
                if (isr)
-                       printk("%s: Possible IRQ conflict on IRQ%d?\n", dev->name, dev->irq);
+                       printk(KERN_DEBUG "%s: Possible IRQ conflict on IRQ%d?\n", dev->name, dev->irq);
                else {
                        /* The 8390 probably hasn't gotten on the cable yet. */
-                       printk("%s: Possible network cable problem?\n", dev->name);
+                       printk(KERN_DEBUG "%s: Possible network cable problem?\n", dev->name);
                        ei_local->interface_num ^= 1;   /* Try a different xcvr.  */
                }
                /* Try to restart the card.  Perhaps the user has fixed something. */
@@ -453,7 +453,7 @@ static void ei_receive(struct device *dev)
                        
                        skb = alloc_skb(sksize, GFP_ATOMIC);
                        if (skb == NULL) {
-                               if (ei_debug)
+                               if (ei_debug > 1)
                                        printk("%s: Couldn't allocate a sk_buff of size %d.\n",
                                                   dev->name, sksize);
                                ei_local->stat.rx_dropped++;
@@ -513,7 +513,7 @@ static void ei_rx_overrun(struct device *dev)
     /* We should already be stopped and in page0.  Remove after testing. */
     outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD);
     
-    if (ei_debug)
+    if (ei_debug > 1)
                printk("%s: Receiver overrun.\n", dev->name);
     ei_local->stat.rx_over_errors++;
     
index 3d897013d914bbd430abf216125ef0bfb2f6ab5b..af675cb08da3f43185e10d59d8fbaecfe6064528 100644 (file)
@@ -75,7 +75,7 @@ static int check(int flag, select_table * wait, struct file * file)
        return 0;
 }
 
-int do_select(int n, fd_set *in, fd_set *out, fd_set *ex,
+static int do_select(int n, fd_set *in, fd_set *out, fd_set *ex,
        fd_set *res_in, fd_set *res_out, fd_set *res_ex)
 {
        int count;
index e7a37b9ea0cf68582c6618d2656005225f064c90..ea49b83d9730f9a11385d268d6dd44581802ef6e 100644 (file)
@@ -155,9 +155,12 @@ void * kmalloc (size_t size, int priority)
 
 /* Sanity check... */
        if (intr_count && priority != GFP_ATOMIC) {
-               printk("kmalloc called nonatomically from interrupt %08lx\n",
-                       ((unsigned long *)&size)[-1]);
-               priority = GFP_ATOMIC;
+               static int count = 0;
+               if (++count < 5) {
+                       printk("kmalloc called nonatomically from interrupt %08lx\n",
+                               ((unsigned long *)&size)[-1]);
+                       priority = GFP_ATOMIC;
+               }
        }
 if (size > MAX_KMALLOC_K * 1024) 
      {
@@ -214,11 +217,14 @@ while (tries --)
 
     /* This can be done with ints on: This is private to this invocation */
     page = (struct page_descriptor *) __get_free_page (priority & GFP_LEVEL_MASK);
-    if (!page) 
-        {
-        printk ("Couldn't get a free page.....\n");
+    if (!page) {
+        static unsigned long last = 0;
+        if (last + 10*HZ < jiffies) {
+               last = jiffies;
+               printk ("Couldn't get a free page.....\n");
+       }
         return NULL;
-        }
+    }
 #if 0
     printk ("Got page %08x to use for %d byte mallocs....",(long)page,sz);
 #endif
index 0a6dfb065eb7e95e0308070b22aa371991a65e16..1550cee911c1e1b9ae13ad39a7a7db943be3afc7 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -595,9 +595,12 @@ unsigned long __get_free_page(int priority)
           Is this code reentrant? */
 
        if (intr_count && priority != GFP_ATOMIC) {
-               printk("gfp called nonatomically from interrupt %08lx\n",
-                       ((unsigned long *)&priority)[-1]);
-               priority = GFP_ATOMIC;
+               static int count = 0;
+               if (++count < 5) {
+                       printk("gfp called nonatomically from interrupt %08lx\n",
+                               ((unsigned long *)&priority)[-1]);
+                       priority = GFP_ATOMIC;
+               }
        }
        save_flags(flag);
 repeat:
index 5d8c570c7e83d276fe135f12b7882b5e901373d6..7df87c1354104bd9781c39fa31c1e6c24f61af00 100644 (file)
@@ -134,6 +134,7 @@ static struct packet_type ip_packet_type = {
 
 struct packet_type *ptype_base = &ip_packet_type;
 static struct sk_buff *volatile backlog = NULL;
+static int backlog_size = 0;
 static unsigned long ip_bcast = 0;
 
 
@@ -482,14 +483,25 @@ dev_queue_xmit(struct sk_buff *skb, struct device *dev, int pri)
 void
 netif_rx(struct sk_buff *skb)
 {
+  static int dropping = 0;
   /* Set any necessary flags. */
   skb->sk = NULL;
   skb->free = 1;
-  
+
+  /* check that we aren't oevrdoing things.. */
+  if (!backlog_size)
+       dropping = 0;
+  else if (backlog_size > 100)
+       dropping = 1;
+  if (dropping) {
+       kfree_skb(skb, FREE_READ);
+       return;
+  }
   /* and add it to the "backlog" queue. */
   IS_SKB(skb);
   skb_queue_tail(&backlog,skb);
-   
+  backlog_size++;
+  
   /* If any packet arrived, mark it for processing. */
   if (backlog != NULL) mark_bh(INET_BH);
 
@@ -607,6 +619,7 @@ inet_bh(void *tmp)
   /* Any data left to process? */
   while((skb=skb_dequeue(&backlog))!=NULL)
   {
+       backlog_size--;
        nitcount=dev_nit;
        flag=0;
        sti();
index f7f085d609036d4ebb9a3aba24bd9aa272379928..9909b836046ad5083e1690a3aeac27b7ebd78759 100644 (file)
@@ -10,6 +10,7 @@
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  *             Donald Becker, <becker@super.org>
+ *             Alan Cox, <gw4pts@gw4pts.ampr.org>
  *
  * Fixes:
  *             Alan Cox        :       Commented a couple of minor bits of surplus code
@@ -40,6 +41,9 @@
  *             Alan Cox        :       Silly ip bug when an overlength
  *                                     fragment turns up. Now frees the
  *                                     queue.
+ *             Linus Torvalds/ :       Memory leakage on fragmentation 
+ *             Alan Cox        :       handling.
+ *             Gerhard Koerting:       Forwarding uses IP priority hints
  *
  * To Fix:
  *             IP option processing is mostly not needed. ip_forward needs to know about routing rules
@@ -831,9 +835,8 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
        offset = ntohs(iph->frag_off);
        flags = offset & ~IP_OFFSET;
        offset &= IP_OFFSET;
-       if (((flags & IP_MF) == 0) && (offset == 0)) 
-       {
-               if (qp != NULL) 
+       if (((flags & IP_MF) == 0) && (offset == 0)) {
+               if (qp != NULL)
                        ip_free(qp);    /* Huh? How could this exist?? */
                return(skb);
        }
@@ -844,20 +847,20 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
         * as we still are receiving fragments.  Otherwise, create a fresh
         * queue entry.
         */
-       if (qp != NULL) 
-       {
-               del_timer(&qp->timer);
-               qp->timer.expires = IP_FRAG_TIME;       /* about 30 seconds     */
-               qp->timer.data = (unsigned long) qp;    /* pointer to queue     */
-               qp->timer.function = ip_expire;         /* expire function      */
-               add_timer(&qp->timer);
-       } 
-       else 
-       {
-               if ((qp = ip_create(skb, iph, dev)) == NULL) 
-                       return(NULL);
-       }
+       if (qp != NULL) {
+               del_timer(&qp->timer);
+               qp->timer.expires = IP_FRAG_TIME;       /* about 30 seconds */
+               qp->timer.data = (unsigned long) qp;    /* pointer to queue */
+               qp->timer.function = ip_expire;         /* expire function */
+               add_timer(&qp->timer);
+       } else {
+               if ((qp = ip_create(skb, iph, dev)) == NULL) {
+                       skb->sk = NULL;
+                       kfree_skb(skb, FREE_READ);
+                       return NULL;
+               }
+       }
+
        /* Determine the position of this fragment. */
        ihl = (iph->ihl * sizeof(unsigned long));
        end = offset + ntohs(iph->tot_len) - ihl;
@@ -924,6 +927,7 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
                        if (tfp->next != NULL) 
                                next->next->prev = next->prev;
                        
+                       kfree_skb(next->skb, FREE_READ);
                        kfree_s(next, sizeof(struct ipfrag));
                }
                DPRINTF((DBG_IP, "IP: defrag: fixed high overlap %d bytes\n", i));
@@ -932,6 +936,11 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
        /* Insert this fragment in the chain of fragments. */
        tfp = NULL;
        tfp = ip_frag_create(offset, end, skb, ptr);
+       if (!tfp) {
+               skb->sk = NULL;
+               kfree_skb(skb, FREE_READ);
+               return NULL;
+       }
        tfp->prev = prev;
        tfp->next = next;
        if (prev != NULL) 
@@ -1000,11 +1009,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
                        dev->name, dev->mtu, left, in_ntoa(iph->saddr)));
                DPRINTF((DBG_IP, " DST=%s\n", in_ntoa(iph->daddr)));
  
-               /*
-                * FIXME:
-                * We should send an ICMP warning message here!
-                */
-                
                icmp_send(skb,ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, dev); 
                return;
        }
@@ -1017,15 +1021,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
        while(left > 0) 
        {
                len = left;
-#ifdef OLD             
-               if (len+8 > mtu) 
-                       len = (dev->mtu - hlen - 8);
-               if ((left - len) >= 8) 
-               {
-                       len /= 8;
-                       len *= 8;
-               }
-#else
                /* IF: it doesn't fit, use 'mtu' - the data space left */
                if (len > mtu)
                        len = mtu;
@@ -1036,7 +1031,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
                        len/=8;
                        len*=8;
                }
-#endif                         
                DPRINTF((DBG_IP,"IP: frag: creating fragment of %d bytes (%d total)\n",
                                                        len, len + hlen));
  
@@ -1199,7 +1193,14 @@ ip_forward(struct sk_buff *skb, struct device *dev, int is_frag)
                kfree_skb(skb2,FREE_WRITE);
        }
        else
-               dev2->queue_xmit(skb2, dev2, SOPRI_NORMAL);
+       {
+               if(iph->tos & IPTOS_LOWDELAY)
+                       dev2->queue_xmit(skb2, dev2, SOPRI_INTERACTIVE);
+               if(iph->tos & IPTOS_THROUGHPUT)
+                       dev2->queue_xmit(skb2, dev2, SOPRI_BACKGROUND);
+               else
+                       dev2->queue_xmit(skb2, dev2, SOPRI_NORMAL);
+       }
   }
 }
 
index 940924029f39f0193cb2abeaf0c5383307fc9271..49b565b4a4ef205203f7b5c0ee0609d288d14ed0 100644 (file)
@@ -429,9 +429,12 @@ struct sk_buff *alloc_skb(unsigned int size,int priority)
        extern unsigned long intr_count;
 
        if (intr_count && priority != GFP_ATOMIC) {
-               printk("alloc_skb called nonatomically from interrupt %08lx\n",
-                       ((unsigned long *)&size)[-1]);
-               priority = GFP_ATOMIC;
+               static int count = 0;
+               if (++count < 5) {
+                       printk("alloc_skb called nonatomically from interrupt %08lx\n",
+                               ((unsigned long *)&size)[-1]);
+                       priority = GFP_ATOMIC;
+               }
        }
        skb=(struct sk_buff *)kmalloc(size,priority);
        if(skb==NULL)
index 59980ad6e01d0daf6644a5da401940a0380a14c9..260e2ad01c4180a0ccb0405ad1fc5307c1f3191d 100644 (file)
@@ -12,6 +12,9 @@
  *             Mark Evans, <evansmp@uhura.aston.ac.uk>
  *             Corey Minyard <wf-rch!minyard@relay.EU.net>
  *             Florian La Roche, <flla@stud.uni-sb.de>
+ *             Charles Hedrick, <hedrick@klinzhai.rutgers.edu>
+ *             Linus Torvalds, <torvalds@cs.helsinki.fi>
+ *             Alan Cox, <gw4pts@gw4pts.ampr.org>
  *
  * Fixes:      
  *             Alan Cox        :       Numerous verify_area() calls
@@ -63,6 +66,7 @@
  *             Charles Hedrick :       Window fix
  *             Linus           :       Rewrote tcp_read() and URG handling
  *                                     completely
+ *             Gerhard Koerting:       Fixed some missing timer handling
  *
  *
  * To Fix:
@@ -1487,8 +1491,13 @@ tcp_shutdown(struct sock *sk, int how)
                           IPPROTO_TCP, sk->opt,
                           sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl);
   if (tmp < 0) {
+       /* Finish anyway, treat this as a send that got lost. */
        buff->free=1;
        prot->wfree(sk,buff->mem_addr, buff->mem_len);
+       if(sk->state==TCP_ESTABLISHED)
+               sk->state=TCP_FIN_WAIT1;
+       else
+               sk->state=TCP_FIN_WAIT2;
        release_sock(sk);
        DPRINTF((DBG_TCP, "Unable to build header for fin.\n"));
        return;
@@ -2024,6 +2033,13 @@ tcp_close(struct sock *sk, int timeout)
                                         sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl);
                if (tmp < 0) {
                        kfree_skb(buff,FREE_WRITE);
+                       if(sk->state==TCP_ESTABLISHED)
+                               sk->state=TCP_FIN_WAIT1;
+                       else
+                               sk->state=TCP_FIN_WAIT2;
+                       reset_timer(sk, TIME_CLOSE,4*sk->rto);
+                       if(timeout)
+                               tcp_time_wait(sk);
                        DPRINTF((DBG_TCP, "Unable to build header for fin.\n"));
                        release_sock(sk);
                        return;
@@ -2854,6 +2870,7 @@ tcp_fin(struct sock *sk, struct tcphdr *th,
        case TCP_SYN_SENT:
        case TCP_ESTABLISHED:
                /* Contains the one that needs to be acked */
+               reset_timer(sk, TIME_CLOSE, TCP_TIMEOUT_LEN);
                sk->fin_seq = th->seq+1;
                sk->state = TCP_CLOSE_WAIT;
                if (th->rst) sk->shutdown = SHUTDOWN_MASK;