diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-07-22 05:26:35 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-07-22 05:26:35 +0000 |
commit | b034971d133858dd8525c941ee389985a28a0782 (patch) | |
tree | 25229051864ec68d662e4505469ba121a4fee1cf /sys | |
parent | 29d3afb3dabf2ecbfa2279ed06e9b67ddce1aefd (diff) |
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@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/st.c | 12 |
1 files 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; |