[PATCH] aacraid: Fix down_interruptible() to check the return value take 2 (was: aacraid broken in git)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux-Scsi <linux-scsi@...>
Cc: James Bottomley <James.Bottomley@...>, <linux-kernel@...>, Andrew Morton <akpm@...>, Yinghai Lu <yhlu.kernel@...>
Date: Wednesday, April 23, 2008 - 8:16 am

On Apr 21, 2008, at 8:42 PM, Yinghai Lu wrote:



The return value for down_interruptible was incorrectly checked!  
updated patch enclosed.

This attached patch is against current scsi-misc-2.6 (minus original  
down_interruptible patch).

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

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>

  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)) {
+			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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
aacraid broken in git, Yinghai Lu, (Fri Apr 18, 9:55 pm)
Re: aacraid broken in git, Mark Salyzyn, (Sat Apr 19, 8:33 am)
Re: aacraid broken in git, Yinghai Lu, (Mon Apr 21, 8:42 pm)
[PATCH] aacraid: Fix down_interruptible() to check the retur..., Mark Salyzyn, (Wed Apr 23, 8:16 am)
Re: aacraid broken in git, Yinghai Lu, (Sat Apr 19, 4:56 pm)