KVM: s390: virtio_ccw: reset errors for new I/O.
authorCornelia Huck <cornelia.huck@de.ibm.com>
Thu, 4 Apr 2013 08:25:06 +0000 (10:25 +0200)
committerGleb Natapov <gleb@redhat.com>
Sun, 7 Apr 2013 10:13:47 +0000 (13:13 +0300)
ccw_io_helper neglected to reset vcdev->err after a new channel
program had been successfully started, resulting in stale errors
delivered after one I/O failed. Reset the error after a new
channel program has been successfully started with no old I/O
pending.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
drivers/s390/kvm/virtio_ccw.c

index 42d507c4e06bdd2bd4cf8f50e81cee5c97f04ea8..5948f2a7b0800a7152bd1a6bbed7010ef3431ed6 100644 (file)
@@ -133,8 +133,11 @@ static int ccw_io_helper(struct virtio_ccw_device *vcdev,
        do {
                spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags);
                ret = ccw_device_start(vcdev->cdev, ccw, intparm, 0, 0);
-               if (!ret)
+               if (!ret) {
+                       if (!vcdev->curr_io)
+                               vcdev->err = 0;
                        vcdev->curr_io |= flag;
+               }
                spin_unlock_irqrestore(get_ccwdev_lock(vcdev->cdev), flags);
                cpu_relax();
        } while (ret == -EBUSY);