aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ata
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2018-01-09 00:10:59 +0000
committerScott Long <scottl@FreeBSD.org>2018-01-09 00:10:59 +0000
commit04e814aecd6a4d831c78c11826d5e8df06b914d5 (patch)
tree43e4810e9871cd416f56c8d01b0c5a1c80116c1b /sys/cam/ata
parent329e7a8b51e0f6a9e621d6a812cc1b6081ad8474 (diff)
downloadsrc-04e814aecd6a4d831c78c11826d5e8df06b914d5.tar.gz
src-04e814aecd6a4d831c78c11826d5e8df06b914d5.zip
Don't hold the periph lock when calling into cam_periph_runccb()
from the ada and da dump routines. This avoids difficult locking problems from needing to be handled. While it might seem like this would leave the periphs unprotected during dump, they were aleady at risk of unexpected removal due to the dump functions not keeping refcount state across the many calls that come in during a dump. This is an exercise for future work. Obtained from: Netflix
Notes
Notes: svn path=/head/; revision=327710
Diffstat (limited to 'sys/cam/ata')
-rw-r--r--sys/cam/ata/ata_da.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index ead4ba2f125b..fa88260c8b51 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -1062,15 +1062,12 @@ adadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
dp = arg;
periph = dp->d_drv1;
softc = (struct ada_softc *)periph->softc;
- cam_periph_lock(periph);
secsize = softc->params.secsize;
lba = offset / secsize;
count = length / secsize;
- if ((periph->flags & CAM_PERIPH_INVALID) != 0) {
- cam_periph_unlock(periph);
+ if ((periph->flags & CAM_PERIPH_INVALID) != 0)
return (ENXIO);
- }
memset(&ataio, 0, sizeof(ataio));
if (length > 0) {
@@ -1098,7 +1095,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
if (error != 0)
printf("Aborting dump due to I/O error.\n");
- cam_periph_unlock(periph);
return (error);
}
@@ -1129,7 +1125,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t len
if (error != 0)
xpt_print(periph->path, "Synchronize cache failed\n");
}
- cam_periph_unlock(periph);
return (error);
}