From owner-svn-src-head@FreeBSD.ORG Wed Jan 25 17:58:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1896A106564A; Wed, 25 Jan 2012 17:58:48 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C498FC0A; Wed, 25 Jan 2012 17:58:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PHwl3r036655; Wed, 25 Jan 2012 17:58:47 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PHwlsO036653; Wed, 25 Jan 2012 17:58:47 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201251758.q0PHwlsO036653@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 25 Jan 2012 17:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230544 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 17:58:48 -0000 Author: ken Date: Wed Jan 25 17:58:47 2012 New Revision: 230544 URL: http://svn.freebsd.org/changeset/base/230544 Log: Fix a bug introduced in r230000. We were eliminating all LUNs on a target in response to CAM_DEV_NOT_THERE, instead of just the LUN in question. This will now just eliminate the specified LUN in response to CAM_DEV_NOT_THERE. Reported by: Richard Todd MFC after: 3 days Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Wed Jan 25 16:00:00 2012 (r230543) +++ head/sys/cam/cam_periph.c Wed Jan 25 17:58:47 2012 (r230544) @@ -1864,13 +1864,26 @@ cam_periph_error(union ccb *ccb, cam_fla case CAM_DEV_NOT_THERE: { struct cam_path *newpath; + lun_id_t lun_id; error = ENXIO; + + /* + * For a selection timeout, we consider all of the LUNs on + * the target to be gone. If the status is CAM_DEV_NOT_THERE, + * then we only get rid of the device(s) specified by the + * path in the original CCB. + */ + if (status == CAM_DEV_NOT_THERE) + lun_id = xpt_path_lun_id(ccb->ccb_h.path); + else + lun_id = CAM_LUN_WILDCARD; + /* Should we do more if we can't create the path?? */ if (xpt_create_path(&newpath, periph, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), - CAM_LUN_WILDCARD) != CAM_REQ_CMP) + lun_id) != CAM_REQ_CMP) break; /*