diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-04-30 02:17:07 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-04-30 02:17:07 +0000 |
commit | 9ce197d09079493d360f0052b2a385d123040829 (patch) | |
tree | 8828f5105a049f46eeeca0a1fe89b2450d12d3b0 /sys/scsi/sd.c | |
parent | 73cdfc4627657fe86084c8f3c47c9569b24167a3 (diff) |
unbreak dumps on scsi disks.
discovered by oga@
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r-- | sys/scsi/sd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 9a78e581019..eae018767c4 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.185 2010/04/23 15:25:21 jsing Exp $ */ +/* $OpenBSD: sd.c,v 1.186 2010/04/30 02:17:06 dlg Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -1186,6 +1186,7 @@ sddump(dev_t dev, daddr64_t blkno, caddr_t va, size_t size) int totwrt; /* total number of sectors left to write */ int nwrt; /* current number of sectors to write */ struct scsi_xfer *xs; /* ... convenience */ + int rv; /* Check if recursive dump; if so, punt. */ if (sddoingadump) @@ -1239,16 +1240,16 @@ sddump(dev_t dev, daddr64_t blkno, caddr_t va, size_t size) return (ENOMEM); xs->timeout = 10000; - xs->flags = SCSI_POLL | SCSI_NOSLEEP | SCSI_DATA_OUT; + xs->flags = SCSI_POLL | SCSI_DATA_OUT; xs->data = va; xs->datalen = nwrt * sectorsize; sd_cmd_rw10(xs, 0, blkno, nwrt); /* XXX */ - scsi_xs_exec(xs); - if (xs->error != XS_NOERROR) - return (ENXIO); + rv = scsi_xs_sync(xs); scsi_xs_put(xs); + if (rv != 0) + return (ENXIO); #else /* SD_DUMP_NOT_TRUSTED */ /* Let's just talk about this first... */ printf("sd%d: dump addr 0x%x, blk %d\n", unit, va, blkno); |