NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/39993



The following reply was made to PR kern/39993; it has been noted by GNATS.

From: Antti Kantee <pooka%cs.hut.fi@localhost>
To: jdc%netbsd.org@localhost, oster%netbsd.org@localhost, 
gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/39993
Date: Thu, 19 Feb 2009 22:39:03 +0200

 --5mCyUwZo2JvN/JJP
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Just some guessing: it appears that bdev_strategy() can block and
 we can call it with the queue spinlock held.  Maybe this will make the
 trouble go away?
 (not blessed by Greg, so test at your own risk ;)
 
 Index: rf_netbsdkintf.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/raidframe/rf_netbsdkintf.c,v
 retrieving revision 1.255
 diff -p -u -r1.255 rf_netbsdkintf.c
 --- rf_netbsdkintf.c   7 Feb 2009 20:36:49 -0000       1.255
 +++ rf_netbsdkintf.c   19 Feb 2009 20:37:01 -0000
 @@ -2130,7 +2130,15 @@ rf_DispatchKernelIO(RF_DiskQueue_t *queu
                        (int) (req->numSector <<
                            queue->raidPtr->logBytesPerSector),
                        (int) queue->raidPtr->logBytesPerSector));
 +
 +              /*
 +               * XXX: drop lock here since this can block at least
 +               * with backing SCSI devices.  Retake it
 +               * to minimize fuss with calling interfaces.
 +               */
 +              RF_UNLOCK_QUEUE_MUTEX(queue, "unusedparam");
                bdev_strategy(bp);
 +              RF_LOCK_QUEUE_MUTEX(queue, "unusedparam");
  
                break;
  
 
 --5mCyUwZo2JvN/JJP
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="rf.diff"
 
 Index: rf_netbsdkintf.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/raidframe/rf_netbsdkintf.c,v
 retrieving revision 1.255
 diff -p -u -r1.255 rf_netbsdkintf.c
 --- rf_netbsdkintf.c   7 Feb 2009 20:36:49 -0000       1.255
 +++ rf_netbsdkintf.c   19 Feb 2009 20:37:01 -0000
 @@ -2130,7 +2130,15 @@ rf_DispatchKernelIO(RF_DiskQueue_t *queu
                        (int) (req->numSector <<
                            queue->raidPtr->logBytesPerSector),
                        (int) queue->raidPtr->logBytesPerSector));
 +
 +              /*
 +               * XXX: drop lock here since this can block at least
 +               * with backing SCSI devices.  Retake it
 +               * to minimize fuss with calling interfaces.
 +               */
 +              RF_UNLOCK_QUEUE_MUTEX(queue, "unusedparam");
                bdev_strategy(bp);
 +              RF_LOCK_QUEUE_MUTEX(queue, "unusedparam");
  
                break;
  
 
 --5mCyUwZo2JvN/JJP--
 


Home | Main Index | Thread Index | Old Index