diff options
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 6f72b80121a0..4df73e52a4f9 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2261,8 +2261,13 @@ bad_sense: sd_printk(KERN_ERR, sdkp, "Asking for cache data failed\n"); defaults: - sd_printk(KERN_ERR, sdkp, "Assuming drive cache: write through\n"); - sdkp->WCE = 0; + if (sdp->wce_default_on) { + sd_printk(KERN_NOTICE, sdkp, "Assuming drive cache: write back\n"); + sdkp->WCE = 1; + } else { + sd_printk(KERN_ERR, sdkp, "Assuming drive cache: write through\n"); + sdkp->WCE = 0; + } sdkp->RCD = 0; sdkp->DPOFUA = 0; } @@ -2704,6 +2709,7 @@ static int sd_probe(struct device *dev) sdkp->disk = gd; sdkp->index = index; atomic_set(&sdkp->openers, 0); + atomic_set(&sdkp->device->ioerr_cnt, 0); if (!sdp->request_queue->rq_timeout) { if (sdp->type != TYPE_MOD) |