From: Hans-Joachim Picht <hpicht@redhat.com> Date: Tue, 30 Oct 2007 16:57:09 +0100 Subject: [s390] cio: Device status validity Message-id: 20071030155709.GB6604@redhat.com O-Subject: [RHEL5.2 PATCH 2/5] s390 cio: Device status validity Bugzilla: 354821 Problem: ========= The device driver assumes the final status for a request while it isn't finished yet. The device status in the irb contains the channel end/device end. The problem was hit by performing I/O stress tesits while pulling/plugging storage cables or performing a variety of logical operations. At some point, data written to disk diverged from expected data (dasd driver received incorrect channel end/device end, however, data was not written to disk). Bugzilla ========= BZ 354821 https://bugzilla.redhat.com/show_bug.cgi?id=354821 Upstream status of the patch: ============================= Fix included in git as commit 25c61a1fe8c97d1352a2dc0eda25128b3be0db27 Test status: ============ Kernel with patch was built and successfully tested Please ACK. With best regards, Hans diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c index 1d53ac1..418954f 100644 --- a/drivers/s390/cio/device_status.c +++ b/drivers/s390/cio/device_status.c @@ -264,7 +264,11 @@ ccw_device_accumulate_irb(struct ccw_device *cdev, struct irb *irb) cdev_irb->scsw.cpa = irb->scsw.cpa; /* Accumulate device status, but not the device busy flag. */ cdev_irb->scsw.dstat &= ~DEV_STAT_BUSY; - cdev_irb->scsw.dstat |= irb->scsw.dstat; + /* dstat is not always valid. */ + if (irb->scsw.stctl & + (SCSW_STCTL_PRIM_STATUS | SCSW_STCTL_SEC_STATUS + | SCSW_STCTL_INTER_STATUS | SCSW_STCTL_ALERT_STATUS)) + cdev_irb->scsw.dstat |= irb->scsw.dstat; /* Accumulate subchannel status. */ cdev_irb->scsw.cstat |= irb->scsw.cstat; /* Copy residual count if it is valid. */