]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.12 2.3.12
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:26:34 +0000 (15:26 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:26:34 +0000 (15:26 -0500)
drivers/parport/probe.c
fs/select.c
include/asm-i386/signal.h
include/linux/arcdevice.h
include/linux/sched.h
kernel/fork.c
mm/memory.c

index a3c24c989c45df9f54755497044c2a6e086170ef..9cfb0079479061de827afacc144c096abd05633f 100644 (file)
@@ -163,17 +163,15 @@ ssize_t parport_device_id (int devnum, char *buffer, size_t len)
                        len = idlen;
                retval = parport_read (dev->port, buffer, len);
 
-               if (retval != len) {
+               if (retval != len)
                        printk (KERN_DEBUG "%s: only read %d of %d ID bytes\n",
                                dev->port->name, retval, len);
-                       goto restore_fs;
-               }
 
                /* Some printer manufacturers mistakenly believe that
                    the length field is supposed to be _exclusive_. */
                /* In addition, there are broken devices out there
                    that don't even finish off with a semi-colon. */
-               if (idlen == len && buffer[len - 1] != ';') {
+               if (buffer[len - 1] != ';') {
                        ssize_t diff;
                        diff = parport_read (dev->port, buffer + len, 2);
                        retval += diff;
@@ -186,7 +184,6 @@ ssize_t parport_device_id (int devnum, char *buffer, size_t len)
                        else {
                                /* One semi-colon short of a device ID. */
                                buffer[len++] = ';';
-                               buffer[len] = '\0';
                                printk (KERN_DEBUG "%s: faking semi-colon\n",
                                        dev->port->name);
 
@@ -199,12 +196,13 @@ ssize_t parport_device_id (int devnum, char *buffer, size_t len)
                }
 
        restore_fs:
+               buffer[len] = '\0';
                set_fs (oldfs);
                parport_negotiate (dev->port, IEEE1284_MODE_COMPAT);
        }
        parport_release (dev);
 
-       if (retval > 0)
+       if (retval > 2)
                parse_data (dev->port, dev->daisy, buffer);
 
        parport_close (dev);
index 9ca5c6d893ecd7feedb709cf2411e6a8a895cdb7..5920d7c365ae6e03ae4810e6dcfb90a9ff6948ba 100644 (file)
@@ -268,8 +268,8 @@ sys_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp)
        if (n < 0)
                goto out_nofds;
 
-       if (n > current->files->max_fdset + 1)
-               n = current->files->max_fdset + 1;
+       if (n > current->files->max_fdset)
+               n = current->files->max_fdset;
 
        /*
         * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
@@ -277,7 +277,7 @@ sys_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp)
         * long-words. 
         */
        ret = -ENOMEM;
-       size = (n + 8 * sizeof(long) - 1) / (8 * sizeof(long)) * sizeof(long);
+       size = FDS_BYTES(n);
        bits = kmalloc(6 * size, GFP_KERNEL);
        if (!bits)
                goto out_nofds;
index 030a19b7bf8fbf7255889e597b6e2e6095c2d900..b6823738b079f3a63ca03dc524e49fba30b61a72 100644 (file)
@@ -180,12 +180,12 @@ typedef struct sigaltstack {
 
 extern __inline__ void sigaddset(sigset_t *set, int _sig)
 {
-       __asm__("btsl %1,%0" : "=m"(*set) : "ir"(_sig - 1) : "cc");
+       __asm__("btsl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc");
 }
 
 extern __inline__ void sigdelset(sigset_t *set, int _sig)
 {
-       __asm__("btrl %1,%0" : "=m"(*set) : "ir"(_sig - 1) : "cc");
+       __asm__("btrl %1,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc");
 }
 
 extern __inline__ int __const_sigismember(sigset_t *set, int _sig)
@@ -198,7 +198,7 @@ extern __inline__ int __gen_sigismember(sigset_t *set, int _sig)
 {
        int ret;
        __asm__("btl %2,%1\n\tsbbl %0,%0"
-               : "=r"(ret) : "m"(*set), "ir"(_sig-1) : "cc");
+               : "=r"(ret) : "m"(*set), "Ir"(_sig-1) : "cc");
        return ret;
 }
 
index 4c0f2e05d8d7172b7984103a64f94a5aa945344a..b4df083e052d3514799114599022e69870b06d64 100644 (file)
@@ -69,7 +69,7 @@
  * increased.  The larger it is, though, the longer it will be between
  * necessary transmits - don't set this too large.
  */
-#define TX_TIMEOUT 20
+#define TX_TIMEOUT (20*HZ/100)
 
 
 /* Display warnings about the driver being an ALPHA version.
index 91346c1c16c72bb6670f25b861bef657777921a9..9d0d9ce3023e787a81e96b92b0cf4d24fb6d45b9 100644 (file)
@@ -35,6 +35,7 @@ extern unsigned long event;
 #define CLONE_PID      0x00001000      /* set if pid shared */
 #define CLONE_PTRACE   0x00002000      /* set if we want to let tracing continue on the child too */
 #define CLONE_VFORK    0x00004000      /* set if the parent wants the child to wake it up on mm_release */
+#define CLONE_PARENT   0x00008000      /* set if we want to have the same parent as the cloner */
 
 /*
  * These are the constant used to fake the fixed-point load-average
index 5a823b008864ad9c47ac3435c2846871dfc12881..5fff2597b7bc82aff33a383504b215c9b8e41b2d 100644 (file)
@@ -637,7 +637,8 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
        p->run_list.next = NULL;
        p->run_list.prev = NULL;
 
-       p->p_pptr = p->p_opptr = current;
+       if ((clone_flags & CLONE_VFORK) || !(clone_flags & CLONE_PARENT))
+               p->p_pptr = p->p_opptr = current;
        p->p_cptr = NULL;
        init_waitqueue_head(&p->wait_chldexit);
        p->vfork_sem = NULL;
index 40a3e95521667425179f1c2469a82524136753e4..b78d4e2deafe44ca8664739a3c18fd07eb5de364 100644 (file)
@@ -475,19 +475,23 @@ int map_user_kiobuf(int rw, struct kiobuf *iobuf, unsigned long va, size_t len)
                        if (!vma) 
                                goto out_unlock;
                }
-               if (!handle_mm_fault(current, vma, ptr, (rw==READ))
+               if (handle_mm_fault(current, vma, ptr, (rw==READ)) <= 0
                        goto out_unlock;
+               spin_lock(&mm->page_table_lock);
                page = follow_page(ptr);
                if (!page) {
-                       printk (KERN_ERR "Missing page in map_user_kiobuf\n");
-                       goto out_unlock;
+                       dprintk (KERN_ERR "Missing page in map_user_kiobuf\n");
+                       map = NULL;
+                       goto retry;
                }
                map = get_page_map(page);
                if (map) {
-                       if (TryLockPage(map))
+                       if (TryLockPage(map)) {
                                goto retry;
+                       }
                        atomic_inc(&map->count);
                }
+               spin_unlock(&mm->page_table_lock);
                dprintk ("Installing page %p %p: %d\n", (void *)page, map, i);
                iobuf->pagelist[i] = page;
                iobuf->maplist[i] = map;
@@ -511,26 +515,31 @@ int map_user_kiobuf(int rw, struct kiobuf *iobuf, unsigned long va, size_t len)
        /* 
         * Undo the locking so far, wait on the page we got to, and try again.
         */
+       spin_unlock(&mm->page_table_lock);
        unmap_kiobuf(iobuf);
        up(&mm->mmap_sem);
 
        /* 
         * Did the release also unlock the page we got stuck on?
         */
-       if (!PageLocked(map)) {
-               /* If so, we may well have the page mapped twice in the
-                * IO address range.  Bad news.  Of course, it _might_
-                * just be a coincidence, but if it happens more than
-                * once, chances are we have a double-mapped page. */
-               if (++doublepage >= 3) {
-                       return -EINVAL;
+       if (map) {
+               if (!PageLocked(map)) {
+                       /* If so, we may well have the page mapped twice
+                        * in the IO address range.  Bad news.  Of
+                        * course, it _might_ * just be a coincidence,
+                        * but if it happens more than * once, chances
+                        * are we have a double-mapped page. */
+                       if (++doublepage >= 3) {
+                               return -EINVAL;
+                       }
                }
+       
+               /*
+                * Try again...
+                */
+               wait_on_page(map);
        }
        
-       /*
-        * Try again...
-        */
-       wait_on_page(map);
        if (++repeat < 16)
                goto repeat;
        return -EAGAIN;