Re: + aacraid-fix-unchecked-down_interruptible.patch added to -mm tree

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

 



Attachment: aacraid_down_interruptible.patch
Description: Binary data



Discussion below.

This attached patch is against current scsi-misc-2.6.

ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments (inline gets damaged, please use attachment).

Signed-off-by: Mark Salyzyn <aacraid@xxxxxxxxxxx>

 drivers/scsi/aacraid/commsup.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff -ru a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/ commsup.c
--- a/drivers/scsi/aacraid/commsup.c	2008-04-14 14:08:00.737201138 -0400
+++ b/drivers/scsi/aacraid/commsup.c	2008-04-14 14:09:34.019252960 -0400
@@ -515,10 +515,12 @@
 				}
 				udelay(5);
 			}
-		} else
-			(void)down_interruptible(&fibptr->event_wait);
+		} else if (down_interruptible(&fibptr->event_wait) == 0) {
+			fibptr->done = 2;
+			up(&fibptr->event_wait);
+		}
 		spin_lock_irqsave(&fibptr->event_lock, flags);
-		if (fibptr->done == 0) {
+		if ((fibptr->done == 0) || (fibptr->done == 2)) {
 			fibptr->done = 2; /* Tell interrupt we aborted */
 			spin_unlock_irqrestore(&fibptr->event_lock, flags);
 			return -EINTR;

Sincerely - Mark Salyzyn

On Apr 10, 2008, at 5:57 PM, James Bottomley wrote:

On Thu, 2008-04-10 at 17:44 -0400, Mark Salyzyn wrote:
     if (down_interruptible(&fibptr->event_wait) == 0) {
             fibptr->done = 2;
               up(&fibptr->event_wait);
     }

would make me feel much more comfortable ... The fib can never be
'freed'. The fib is owned by the adapter until it completes it on it's
own (if ever, the assumption here is that the adapter is misbehaving
on this 'one' fib). Setting the value of 2 allows us to report back to
the ioctl caller a failed operation without actually closing out the
fib.

I am having a problem with my bandwidth right now to do a unit test to
see if this gets the job done.

That's OK ... send the patch when you're ready; I'll make sure it gets
upstream.  We'll do the standard put it into scsi-misc and backport if
it seems stable, so we'll have time to shake out any problems.

James

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux