Re: [SCSI] allow sleeping in ->eh_device_reset_handler()

From: Dave Jones (davej_at_redhat.com)
Date: 06/20/05

  • Next message: Alexey Dobriyan: "Re: 2.6.12-mm1 (kernel BUG at fs/open.c:935!)"
    Date:	Mon, 20 Jun 2005 17:30:54 -0400
    To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
    
    

    On Sat, Jun 18, 2005 at 11:20:21AM -0700, Linux Kernel wrote:
    > tree 1609752ea7a9adb28583147f0bea33a9f10877d7
    > parent 8fa728a26886f56a9ee10a44fea0ddda301d21c3
    > author Jeff Garzik <jgarzik@pobox.com> Sat, 28 May 2005 15:55:48 -0400
    > committer Jeff Garzik <jgarzik@pobox.com> Fri, 17 Jun 2005 22:05:03 -0500
    >
    > [SCSI] allow sleeping in ->eh_device_reset_handler()
    >
    > Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

     .. deletia ...
     
    > ===================================================================
    > --- 105ead5c90057400abae0c8aa9e2b5ba1818c327/drivers/scsi/megaraid.c (mode:100644 sha1:8d707b29027da4dcab34942adcc7aac9f5e11a8e)
    > +++ 1609752ea7a9adb28583147f0bea33a9f10877d7/drivers/scsi/megaraid.c (mode:100644 sha1:80b0c40c522b7023369c6498ad24165892b8ff55)
    > @@ -1938,7 +1938,7 @@ megaraid_abort(Scsi_Cmnd *cmd)
    >
    >
    > static int
    > -megaraid_reset(Scsi_Cmnd *cmd)
    > +__megaraid_reset(Scsi_Cmnd *cmd)
    > {
    > adapter_t *adapter;
    > megacmd_t mc;
    > @@ -1972,6 +1972,18 @@ megaraid_reset(Scsi_Cmnd *cmd)
    > return rval;
    > }
    >
    > +static int
    > +megaraid_reset(Scsi_Cmnd *cmd)
    > +{
    > + adapter = (adapter_t *)cmd->device->host->hostdata;
    > + int rc;
    > +
    > + spin_lock_irq(&adapter->lock);
    > + rc = __megaraid_reset(cmd);
    > + spin_unlock_irq(&adapter->lock);
    > +
    > + return rc;
    > +}

    This doesn't compile.

    drivers/scsi/megaraid.c:1978: error: 'adapter' undeclared (first use in this function)
    drivers/scsi/megaraid.c:1978: error: (Each undeclared identifier is reported only once
    drivers/scsi/megaraid.c:1978: error: for each function it appears in.)
    drivers/scsi/megaraid.c:1979: warning: ISO C90 forbids mixed declarations and code

    This should fix it.. (untested due to lack of hardware)

    Signed-off-by: Dave Jones <davej@redhat.com>

    --- linux-2.6.12/drivers/scsi/megaraid.c~ 2005-06-20 17:23:27.000000000 -0400
    +++ linux-2.6.12/drivers/scsi/megaraid.c 2005-06-20 17:29:03.000000000 -0400
    @@ -1975,9 +1975,11 @@ __megaraid_reset(Scsi_Cmnd *cmd)
     static int
     megaraid_reset(Scsi_Cmnd *cmd)
     {
    - adapter = (adapter_t *)cmd->device->host->hostdata;
    + adapter_t *adapter;
             int rc;
     
    + adapter = cmd->device->host->hostdata;
    +
             spin_lock_irq(&adapter->lock);
             rc = __megaraid_reset(cmd);
             spin_unlock_irq(&adapter->lock);

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


  • Next message: Alexey Dobriyan: "Re: 2.6.12-mm1 (kernel BUG at fs/open.c:935!)"

    Relevant Pages

    • [patch 2/2] fs/devpts: use lib/parser
      ... Use lib/parser.c for parsing mount options (item from "2.6 should fix"). ... Compile & boot tested. ... static int devpts_remount ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [patch 3/4] fs/devpts: use lib/parser
      ... Use lib/parser.c for parsing mount options (item from "2.6 should fix"). ... Compile & boot tested. ... static int devpts_remount ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [patch 4/5] fs/devpts: use lib/parser
      ... Use lib/parser.c for parsing mount options (item from "2.6 should fix"). ... Compile & boot tested. ... static int devpts_remount ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: dev->release = (void (*)(struct device *))kfree;
      ... will still be unregistered (removed from the various lists) but the ... releasecallback won't be called until the last user. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [RFC] rwsem removal from kobj_map
      ... static int __init genhd_device_init ... static void cdev_default_release ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)