summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2012-06-21 15:14:51 +0000
committermav <mav@FreeBSD.org>2012-06-21 15:14:51 +0000
commitb8ac542c351c0aeaf6e9b5c473e66d4f3195dcc8 (patch)
tree9b1ba690a4cfad3f98e41be3048b3b526a3c21e7 /sys/cam
parenta632fb1531c5c06b7b1317b3ae558e9347801881 (diff)
downloadFreeBSD-src-b8ac542c351c0aeaf6e9b5c473e66d4f3195dcc8.zip
FreeBSD-src-b8ac542c351c0aeaf6e9b5c473e66d4f3195dcc8.tar.gz
Make cam_periph_hold() behavior consistent: drop taken reference and
return ENXIO if periph was invalidated while we were waiting for it. MFC after: 1 week
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_periph.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index b528161..5df9f5b 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -440,6 +440,10 @@ cam_periph_hold(struct cam_periph *periph, int priority)
cam_periph_release_locked(periph);
return (error);
}
+ if (periph->flags & CAM_PERIPH_INVALID) {
+ cam_periph_release_locked(periph);
+ return (ENXIO);
+ }
}
periph->flags |= CAM_PERIPH_LOCKED;
OpenPOWER on IntegriCloud