]> err.no Git - linux-2.6/commitdiff
[SCSI] aacraid: Fix down_interruptible() to check the return value
authorMark Salyzyn <Mark_Salyzyn@adaptec.com>
Mon, 14 Apr 2008 18:20:16 +0000 (14:20 -0400)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 16 Apr 2008 14:32:43 +0000 (09:32 -0500)
Instead of ignoring the return value in aac_fib_send() return 2 to
indicate to the layers above that fib transmission was aborted due to
timeout.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/aacraid/commsup.c

index 5156e057d06224d59d941e6b8c323fadbcae5b8a..23a8e9f8dcb4666126e28a22ac86c1c60f045537 100644 (file)
@@ -515,10 +515,12 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
                                }
                                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;