Skip to contentSkip to conversation

libata: fix infinite EH waiting bug

PATCH Applied Tejun Heo 2 participants 2 messages Jun 25, 2007 – Jun 27, 2007 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: fix infinite EH waiting bug

When EH gives up after repeated exceptions, it doesn't't clear the PENDING bit on exit which leaves PENDING bit set without EH actually scheduled. This makes ata_port_wait_eh() to wait forever makes rmmod hang on such port. Fix it by clearing the flag.

---
 drivers/ata/libata-eh.c |    1 +
 1 file changed, 1 insertion(+)
drivers/ata/libata-eh.c +1 -0
index d807098..fbdfefb 100644
@@ -336,6 +336,7 @@ void ata_scsi_error(struct Scsi_Host *host)
 			}
 			ata_port_printk(ap, KERN_ERR, "EH pending after %d "
 					"tries, giving up\n", ATA_EH_MAX_REPEAT);
+			ap->pflags &= ~ATA_PFLAG_EH_PENDING;
 		}
 
 		/* this run is complete, make sure EH info is clear */
Applied
#1 lore raw
Quoted 15 lines · Tejun Heo

When EH gives up after repeated exceptions, it doesn't't clear the PENDING bit on exit which leaves PENDING bit set without EH actually scheduled. This makes ata_port_wait_eh() to wait forever makes rmmod hang on such port. Fix it by clearing the flag.

---
 drivers/ata/libata-eh.c |    1 +
 1 file changed, 1 insertion(+)
drivers/ata/libata-eh.c +0 -0
index d807098..fbdfefb 100644

drivers/ata/libata-eh.c void ata_scsi_error(struct Scsi_Host *host) · line 341

Quoted 6 lines
drivers/ata/libata-eh.c +1 -0
@@ -336,6 +336,7 @@ void ata_scsi_error(struct Scsi_Host *host)
 			}
 			ata_port_printk(ap, KERN_ERR, "EH pending after %d "
 					"tries, giving up\n", ATA_EH_MAX_REPEAT);
+			ap->pflags &= ~ATA_PFLAG_EH_PENDING;
 		}
 

applied