From: Michael Holzheu Date: Fri, 24 Mar 2006 11:15:27 +0000 (-0800) Subject: [PATCH] s390: tape operation abortion leads to panic X-Git-Tag: upstream/snapshot3+hdmi~42074 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4cd190a736a97e302c038bd91357d636369d4c6b;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [PATCH] 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. Signed-off-by: Michael Holzheu Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index c42f5e2..5d17149 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c @@ -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;