From 6154a1e96b4d9a1c1ec0013748c75835f38b0741 Mon Sep 17 00:00:00 2001 From: matthew Date: Thu, 22 Jul 2010 05:26:34 +0000 Subject: [PATCH] In st_space() and st_write_filemarks(), if scsi_xs_get() returns NULL, set st->media_fileno and st->media_blkno before returning. Not sure if this is needed or even really correct, but it's an unintentional behavior change due to removing scsi_scsi_cmd(). ok dlg@ --- sys/scsi/st.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/scsi/st.c b/sys/scsi/st.c index 694ea6cc5b4..44fdd294666 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -1,4 +1,4 @@ -/* $OpenBSD: st.c,v 1.105 2010/07/22 00:31:06 krw Exp $ */ +/* $OpenBSD: st.c,v 1.106 2010/07/22 05:26:34 matthew Exp $ */ /* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */ /* @@ -1726,8 +1726,11 @@ st_space(struct st_softc *st, int number, u_int what, int flags) return 0; xs = scsi_xs_get(st->sc_link, flags); - if (xs == NULL) + if (xs == NULL) { + st->media_fileno = -1; + st->media_blkno = -1; return (ENOMEM); + } xs->cmd->opcode = SPACE; cmd = (struct scsi_space *)xs->cmd; @@ -1781,8 +1784,11 @@ st_write_filemarks(struct st_softc *st, int number, int flags) return (EINVAL); xs = scsi_xs_get(st->sc_link, flags); - if (xs == NULL) + if (xs == NULL) { + st->media_fileno = -1; + st->media_blkno = -1; return (ENOMEM); + } xs->cmd->opcode = WRITE_FILEMARKS; xs->cmdlen = sizeof(*cmd); xs->timeout = ST_IO_TIME * 4; -- 2.20.1