]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/char/tape_core.c
[PATCH] s390: tape operation abortion leads to panic
[linux-2.6-omap-h63xx.git] / drivers / s390 / char / tape_core.c
index 4ea438c749c9c6f4764ea1056c1baae1d1c52446..5d17149a65299c4fd26aa985b4f3a3f0b3e152e5 100644 (file)
@@ -1015,7 +1015,7 @@ tape_do_io_interruptible(struct tape_device *device,
                                wq,
                                (request->callback == NULL)
                        );
-               } while (rc != -ERESTARTSYS);
+               } while (rc == -ERESTARTSYS);
 
                DBF_EVENT(3, "IO stopped on %08x\n", device->cdev_id);
                rc = -ERESTARTSYS;
@@ -1064,15 +1064,16 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
        /*
         * If the condition code is not zero and the start function bit is
         * still set, this is an deferred error and the last start I/O did
-        * not succeed. Restart the request now.
+        * not succeed. At this point the condition that caused the deferred
+        * error might still apply. So we just schedule the request to be
+        * started later.
         */
        if (irb->scsw.cc != 0 && (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
                PRINT_WARN("(%s): deferred cc=%i. restaring\n",
                        cdev->dev.bus_id,
                        irb->scsw.cc);
-               rc = __tape_start_io(device, request);
-               if (rc)
-                       __tape_end_request(device, request, rc);
+               request->status = TAPE_REQUEST_QUEUED;
+               schedule_work(&device->tape_dnr);
                return;
        }