--- drivers/scsi-orig/st.c 2005-09-14 17:44:16.000000000 -0400 +++ drivers/scsi/st.c 2005-09-15 17:36:52.000000000 -0400 @@ -353,7 +353,14 @@ (STp->buffer)->last_SRpnt = SCpnt->sc_request; DEB( STp->write_pending = 0; ) - complete(SCpnt->request.waiting); + if ((STp->buffer)->writing) { + /* This is a write-behind request, we need to release the + * scsi request struct */ + (STp->buffer)->syscall_result = st_chk_result(STp, SCpnt->sc_request); + SCpnt->sc_request->sr_request.waiting = NULL; + scsi_release_request(SCpnt->sc_request); + } + complete(&(STp->wait)); } @@ -423,10 +430,6 @@ ) /* end DEB */ wait_for_completion(&(STp->wait)); - (STp->buffer)->last_SRpnt->sr_request.waiting = NULL; - - (STp->buffer)->syscall_result = st_chk_result(STp, (STp->buffer)->last_SRpnt); - scsi_release_request((STp->buffer)->last_SRpnt); STbuffer->buffer_bytes -= STbuffer->writing; STps = &(STp->ps[STp->partition]);