Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jun 2012 15:14:51 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237401 - head/sys/cam
Message-ID:  <201206211514.q5LFEpIv020272@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Jun 21 15:14:51 2012
New Revision: 237401
URL: http://svn.freebsd.org/changeset/base/237401

Log:
  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

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Thu Jun 21 14:55:35 2012	(r237400)
+++ head/sys/cam/cam_periph.c	Thu Jun 21 15:14:51 2012	(r237401)
@@ -440,6 +440,10 @@ cam_periph_hold(struct cam_periph *perip
 			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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206211514.q5LFEpIv020272>