Skip to contentSkip to conversation

SCSI: don't return errors for failures in sd_suspend()

PATCH In review Oliver Neukum 2 participants 3 messages Oct 5, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SCSI: don't return errors for failures in sd_suspend()

Quoted 1 line

From f4eee84ae76a303f8ceca761f0d9e3813b4d45cb Mon Sep 17 00:00:00 2001

From: Oliver Neukum <[email protected]>
Date: Tue, 5 Oct 2010 16:10:30 +0200
Subject: [PATCH] SCSI: don't return errors for failures in sd_suspend()

If an uncoorectable error happens during the suspension of an sd device, the device is unsalvageable. The error can be ignored, as offlined devices will be ignored in the future anyway.

---
 drivers/scsi/sd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/scsi/sd.c +2 -1
index ffa0689..5bda210 100644
@@ -2526,7 +2526,8 @@ static int sd_suspend(struct device *dev, pm_message_t mesg)
 
 done:
 	scsi_disk_put(sdkp);
-	return ret;
+	sd_printk(KERN_ERR, sdkp, "Error %d suspending device\n", ret);
+	return 0;
 }
 
 static int sd_resume(struct device *dev)
Signature · 1 line
1.7.1
#1 lore raw
Quoted 9 lines · Oliver Neukum

From f4eee84ae76a303f8ceca761f0d9e3813b4d45cb Mon Sep 17 00:00:00 2001
From: Oliver Neukum <[email protected]>
Date: Tue, 5 Oct 2010 16:10:30 +0200
Subject: [PATCH] SCSI: don't return errors for failures in sd_suspend()

If an uncoorectable error happens during the suspension of an sd device, the device is unsalvageable. The error can be ignored, as offlined devices will be ignored in the future anyway.

More justification please ...

Lying to upper layers about errors (or just ignoring them) has been a huge problem with our stack error handling which we are trying to correct.

The most likely cause of error is cache sync failure so at the point of power off for suspend, we'll lose data. This might not be an uncorrectable error either; it could be memory allocation failure or a host of other transient reasons.

James

#2 lore raw

Am Dienstag, 5. Oktober 2010, 16:38:17 schrieb James Bottomley:

Quoted 4 lines

The most likely cause of error is cache sync failure so at the point of power off for suspend, we'll lose data. This might not be an uncorrectable error either; it could be memory allocation failure or a host of other transient reasons.

OK, then I'll come up with something ultraconservative.

Regards
Oliver