Skip to contentSkip to conversation

s390: tape operation abortion leads to panic

PATCH In review Martin Schwidefsky 1 participant 1 message Mar 22, 2006 s390

lore
Share & tools
lore
#0 lore raw

PATCH 18/24 s390: tape operation abortion leads to panic

From: Michael Holzheu <[email protected]>

[patch 18/24] s390: tape operation abortion leads to panic

When a request is aborted because of a signal, we currently stop the request via csh, but we do not wait for the interrupt of csh in any case. We free the request structure and therefore when the interrupt for the csh operation is presented, the request object is no longer valid and an invalid callback pointer is used.
To fix this wait until the interrupt for csh arrives and until wait_event_interruptible() does not return -ERESTARTSYS.

---

 drivers/s390/char/tape_core.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/tape_core.c +1 -1
diff -urpN linux-2.6/drivers/s390/char/tape_core.c linux-2.6-patched/drivers/s390/char/tape_core.c
@@ -1015,7 +1015,7 @@ tape_do_io_interruptible(struct tape_dev
 				wq,
 				(request->callback == NULL)
 			);
-		} while (rc != -ERESTARTSYS);
+		} while (rc == -ERESTARTSYS);
 
 		DBF_EVENT(3, "IO stopped on %08x\n", device->cdev_id);
 		rc = -ERESTARTSYS;