Skip to contentSkip to conversation

old bug in sym53c8xx still lurks in 2.2.20pre

PATCH Michal Jaegermann 2 participants 2 messages Oct 25, 2001 – Oct 27, 2001 SCSI

lore
Share & tools
lore
#0 lore raw

Gerard Roudier posted at the beginning of an April a fix to a queue handling in that driver which seems to be forgotten. I was looking through 2.2.20pre and found that the bug is still there.

There are two things about the bug - it may actually hit (some got it while running cdparanoia) and if you look closer at the original code you will see that it is quite suspicious. :-)

Here it is again the fix as posted by Gerard re-diffed against 2.2.19something sources. It still applies cleanly to 2.2.20pre11.

drivers/scsi/sym53c8xx.c renamed from drivers/scsi/sym53c8xx.c.symx +4 -5
@@ -10125,14 +10125,13 @@
 				if (i >= MAX_START*2)
 					i = 0;
 			}
-			assert(k != -1);
-			if (k != 1) {
+			if (k != -1) {
 				np->squeue[k] = np->squeue[i]; /* Idle task */
 				np->squeueput = k; /* Start queue pointer */
-				cp->host_status = HS_ABORTED;
-				cp->scsi_status = S_ILLEGAL;
-				ncr_complete(np, cp);
 			}
+			cp->host_status = HS_ABORTED;
+			cp->scsi_status = S_ILLEGAL;
+			ncr_complete(np, cp);
 		}
 		break;
 	/*

Hm, I should possibly check the latest 2.4s as well.

Michal

#1 lore raw
Quoted 34 lines · Michal Jaegermann

Gerard Roudier posted at the beginning of an April a fix to a queue handling in that driver which seems to be forgotten. I was looking through 2.2.20pre and found that the bug is still there.

There are two things about the bug - it may actually hit (some got it while running cdparanoia) and if you look closer at the original code you will see that it is quite suspicious. :-)

Here it is again the fix as posted by Gerard re-diffed against 2.2.19something sources. It still applies cleanly to 2.2.20pre11.

drivers/scsi/sym53c8xx.c renamed from drivers/scsi/sym53c8xx.c.symx +4 -5
@@ -10125,14 +10125,13 @@
 				if (i >= MAX_START*2)
 					i = 0;
 			}
-			assert(k != -1);
-			if (k != 1) {
+			if (k != -1) {
 				np->squeue[k] = np->squeue[i]; /* Idle task */
 				np->squeueput = k; /* Start queue pointer */
-				cp->host_status = HS_ABORTED;
-				cp->scsi_status = S_ILLEGAL;
-				ncr_complete(np, cp);
 			}
+			cp->host_status = HS_ABORTED;
+			cp->scsi_status = S_ILLEGAL;
+			ncr_complete(np, cp);
 		}
 		break;
 	/*
Quoted 1 line

Hm, I should possibly check the latest 2.4s as well.

i just checked 2.4.14-pre2 and this patch is in there. i didn't check on older version or when it arrived so it may be in 2.4.X going way back.

Signature · 2 lines
J o h a n  K u l l s t a m
[[email protected]]