From owner-svn-src-all@FreeBSD.ORG Sat Jan 11 16:37:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38FA7DDB; Sat, 11 Jan 2014 16:37:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 197601F15; Sat, 11 Jan 2014 16:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0BGbK6n042765; Sat, 11 Jan 2014 16:37:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0BGbKr6042764; Sat, 11 Jan 2014 16:37:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201401111637.s0BGbKr6042764@svn.freebsd.org> From: Alexander Motin Date: Sat, 11 Jan 2014 16:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260547 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2014 16:37:21 -0000 Author: mav Date: Sat Jan 11 16:37:20 2014 New Revision: 260547 URL: http://svnweb.freebsd.org/changeset/base/260547 Log: Fix for r260541: do not drop periph reference when request is restarted. CAM_DEV_QFREEZE flag is still there and it will freeze device again. Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sat Jan 11 15:38:31 2014 (r260546) +++ head/sys/cam/scsi/scsi_xpt.c Sat Jan 11 16:37:20 2014 (r260547) @@ -1108,10 +1108,9 @@ probedone(struct cam_periph *periph, uni if (cam_periph_error(done_ccb, 0, SF_NO_PRINT, NULL) == ERESTART) { -out: +outr: /* Drop freeze taken due to CAM_DEV_QFREEZE */ cam_release_devq(path, 0, 0, 0, FALSE); - cam_periph_release_locked(periph); return; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) @@ -1123,7 +1122,11 @@ out: PROBE_SET_ACTION(softc, PROBE_INQUIRY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - goto out; +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE and release. */ + cam_release_devq(path, 0, 0, 0, FALSE); + cam_periph_release_locked(periph); + return; } case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: @@ -1210,7 +1213,7 @@ out: ? SF_RETRY_UA|SF_QUIET_IR : SF_RETRY_UA, &softc->saved_ccb) == ERESTART) { - goto out; + goto outr; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, @@ -1251,7 +1254,7 @@ out: done_ccb->ccb_h.target_lun > 0 ? SF_RETRY_UA|SF_QUIET_IR : SF_RETRY_UA, &softc->saved_ccb) == ERESTART) { - goto out; + goto outr; } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { xpt_release_devq(done_ccb->ccb_h.path, 1, @@ -1361,7 +1364,7 @@ out: } else if (cam_periph_error(done_ccb, 0, SF_RETRY_UA|SF_NO_PRINT, &softc->saved_ccb) == ERESTART) { - goto out; + goto outr; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, @@ -1404,7 +1407,7 @@ out: } else if (cam_periph_error(done_ccb, 0, SF_RETRY_UA|SF_NO_PRINT, &softc->saved_ccb) == ERESTART) { - goto out; + goto outr; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, @@ -1449,7 +1452,7 @@ out: } else if (cam_periph_error(done_ccb, 0, SF_RETRY_UA, &softc->saved_ccb) == ERESTART) { - goto out; + goto outr; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, @@ -1504,7 +1507,7 @@ probe_device_check: } else if (cam_periph_error(done_ccb, 0, SF_RETRY_UA|SF_NO_PRINT, &softc->saved_ccb) == ERESTART) { - goto out; + goto outr; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,