diff options
author | Scott Long <scottl@FreeBSD.org> | 2007-04-18 05:14:16 +0000 |
---|---|---|
committer | Scott Long <scottl@FreeBSD.org> | 2007-04-18 05:14:16 +0000 |
commit | 545f17a3c811e46b83ff5d4411541835dac35bfb (patch) | |
tree | f21d0e445a035418461390525769829b266cd832 /sys/cam/scsi/scsi_da.c | |
parent | 8008a935a77868d1b703a4aec2e8d7d4d33144d2 (diff) | |
download | src-545f17a3c811e46b83ff5d4411541835dac35bfb.tar.gz src-545f17a3c811e46b83ff5d4411541835dac35bfb.zip |
Missed locking the dump and shutdown entry points in the scsi_da driver.
Notes
Notes:
svn path=/head/; revision=168832
Diffstat (limited to 'sys/cam/scsi/scsi_da.c')
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 558360bdbd00..23930135e4fe 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -775,10 +775,13 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng if (periph == NULL) return (ENXIO); softc = (struct da_softc *)periph->softc; + cam_periph_lock(periph); secsize = softc->params.secsize; - if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) + if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { + cam_periph_unlock(periph); return (ENXIO); + } if (length > 0) { periph->flags |= CAM_PERIPH_POLLED; @@ -810,6 +813,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng periph->flags |= CAM_PERIPH_POLLED; return(EIO); } + cam_periph_unlock(periph); return(0); } @@ -851,6 +855,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng } } periph->flags &= ~CAM_PERIPH_POLLED; + cam_periph_unlock(periph); return (0); } @@ -1977,6 +1982,8 @@ dashutdown(void * arg, int howto) TAILQ_FOREACH(periph, &dadriver.units, unit_links) { union ccb ccb; + + cam_periph_lock(periph); softc = (struct da_softc *)periph->softc; /* @@ -2027,7 +2034,7 @@ dashutdown(void * arg, int howto) /*reduction*/0, /*timeout*/0, /*getcount_only*/0); - + cam_periph_unlock(periph); } } |