[PATCH] lock troubles in pre6-2

From: Rusty Russell (rusty@linuxcare.com.au)
Date: Sat Aug 05 2000 - 08:42:37 EDT

  • Next message: Tigran Aivazian: "Re: bug in ne.c/isapnp"

    Thanks to Andy Chou and Dawson Engler for working reporting these.
    I just wrote this (no-brainer) patch.

    The mm and pcmcia ones look particularly interesting.

    Rusty.

    diff -urN -X /tmp/file6lPIUG --minimal linux-2.4.0-test6-5/drivers/net/82596.c working-2.4.0-test6-5/drivers/net/82596.c
    --- linux-2.4.0-test6-5/drivers/net/82596.c Fri May 12 13:22:22 2000
    +++ working-2.4.0-test6-5/drivers/net/82596.c Sat Aug 5 22:28:49 2000
    @@ -706,8 +706,10 @@
     
             spin_lock_irqsave (&lp->lock, flags);
     
    - if (wait_cmd(dev,lp,1000,"timed out waiting to issue RX_START"))
    + if (wait_cmd(dev,lp,1000,"timed out waiting to issue RX_START")) {
    + spin_unlock_irqrestore ((&lp->lock, flags);
                     goto failed;
    + }
             DEB(DEB_INIT,printk("%s: Issuing RX_START\n", dev->name));
             lp->scb.command = RX_START;
             CA(dev);
    diff -urN -X /tmp/file6lPIUG --minimal linux-2.4.0-test6-5/drivers/net/fc/iph5526.c working-2.4.0-test6-5/drivers/net/fc/iph5526.c
    --- linux-2.4.0-test6-5/drivers/net/fc/iph5526.c Fri Jul 28 21:36:34 2000
    +++ working-2.4.0-test6-5/drivers/net/fc/iph5526.c Sat Aug 5 22:19:59 2000
    @@ -3952,8 +3952,10 @@
     
             /* Get an used OX_ID. We could have pending commands.
              */
    - if (get_scsi_oxid(fi))
    + if (get_scsi_oxid(fi)) {
    + spin_unlock_irqrestore(&fi->fc_lock, flags);
                     return 1;
    + }
             fi->q.free_scsi_oxid[fi->g.scsi_oxid] = OXID_INUSE;
     
             /* Maintain a handler so that we can associate the done() function
    diff -urN -X /tmp/file6lPIUG --minimal linux-2.4.0-test6-5/drivers/pcmcia/cs.c working-2.4.0-test6-5/drivers/pcmcia/cs.c
    --- linux-2.4.0-test6-5/drivers/pcmcia/cs.c Fri Jul 28 21:36:35 2000
    +++ working-2.4.0-test6-5/drivers/pcmcia/cs.c Sat Aug 5 22:30:03 2000
    @@ -975,8 +975,10 @@
             client = &s->clients;
             while ((*client) && ((*client) != handle))
                 client = &(*client)->next;
    - if (*client == NULL)
    + if (*client == NULL) {
    + spin_unlock_irqrestore(&s->lock, flags);
                 return CS_BAD_HANDLE;
    + }
             *client = handle->next;
             handle->client_magic = 0;
             kfree(handle);
    diff -urN -X /tmp/file6lPIUG --minimal linux-2.4.0-test6-5/mm/vmscan.c working-2.4.0-test6-5/mm/vmscan.c
    --- linux-2.4.0-test6-5/mm/vmscan.c Sat Aug 5 22:08:19 2000
    +++ working-2.4.0-test6-5/mm/vmscan.c Sat Aug 5 22:37:59 2000
    @@ -321,8 +321,10 @@
     
                     for (;;) {
                             int result = swap_out_vma(mm, vma, address, gfp_mask);
    - if (result)
    + if (result) {
    + vmlist_access_unlock(mm);
                                     return result;
    + }
                             vma = vma->vm_next;
                             if (!vma)
                                     break;

    --
    Hacking time.
    

    - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat Aug 05 2000 - 08:46:43 EDT