summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2007-04-18 05:14:16 +0000
committerscottl <scottl@FreeBSD.org>2007-04-18 05:14:16 +0000
commitf3971f41d35f40951fdd1d21a978ac5c2ca5beff (patch)
treef21d0e445a035418461390525769829b266cd832 /sys/cam
parenta40b57339d0ae20db108ee7c13ef670039d1f2c7 (diff)
downloadFreeBSD-src-f3971f41d35f40951fdd1d21a978ac5c2ca5beff.zip
FreeBSD-src-f3971f41d35f40951fdd1d21a978ac5c2ca5beff.tar.gz
Missed locking the dump and shutdown entry points in the scsi_da driver.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_da.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 558360b..2393013 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);
}
}
OpenPOWER on IntegriCloud