From owner-svn-src-stable@freebsd.org Mon Oct 5 09:06:18 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F282CA10E59; Mon, 5 Oct 2015 09:06:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E36B41D31; Mon, 5 Oct 2015 09:06:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9596I9g023576; Mon, 5 Oct 2015 09:06:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9596I4u023575; Mon, 5 Oct 2015 09:06:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510050906.t9596I4u023575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 5 Oct 2015 09:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r288742 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2015 09:06:19 -0000 Author: mav Date: Mon Oct 5 09:06:18 2015 New Revision: 288742 URL: https://svnweb.freebsd.org/changeset/base/288742 Log: MFC r287720: Fix false CTL_UA_RES_RELEASE on secondary HA node. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Mon Oct 5 09:05:23 2015 (r288741) +++ stable/10/sys/cam/ctl/ctl.c Mon Oct 5 09:06:18 2015 (r288742) @@ -8406,7 +8406,7 @@ ctl_hndl_per_res_out_on_other_sc(union c struct ctl_lun *lun; struct ctl_softc *softc; int i; - uint32_t targ_lun; + uint32_t residx, targ_lun; softc = control_softc; targ_lun = msg->hdr.nexus.targ_mapped_lun; @@ -8422,6 +8422,7 @@ ctl_hndl_per_res_out_on_other_sc(union c mtx_unlock(&lun->lun_lock); return; } + residx = ctl_get_initindex(&msg->hdr.nexus); switch(msg->pr.pr_info.action) { case CTL_PR_REG_KEY: ctl_alloc_prkey(lun, msg->pr.pr_info.residx); @@ -8486,8 +8487,9 @@ ctl_hndl_per_res_out_on_other_sc(union c if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = softc->init_min; i < softc->init_max; i++) - if (ctl_get_prkey(lun, i) != 0) - ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); + if (i == residx || ctl_get_prkey(lun, i) == 0) + continue; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } lun->flags &= ~CTL_LUN_PR_RESERVED;