From owner-svn-src-all@freebsd.org Mon Oct 5 11:48:15 2015 Return-Path: Delivered-To: svn-src-all@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 0044899A8CE; Mon, 5 Oct 2015 11:48:15 +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 E61C8698; Mon, 5 Oct 2015 11:48:14 +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 t95BmE5D097081; Mon, 5 Oct 2015 11:48:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t95BmEBJ097080; Mon, 5 Oct 2015 11:48:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510051148.t95BmEBJ097080@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 11:48:14 +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: r288820 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 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: Mon, 05 Oct 2015 11:48:15 -0000 Author: mav Date: Mon Oct 5 11:48:14 2015 New Revision: 288820 URL: https://svnweb.freebsd.org/changeset/base/288820 Log: MFC r288449: Implement SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior. 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 11:47:16 2015 (r288819) +++ stable/10/sys/cam/ctl/ctl.c Mon Oct 5 11:48:14 2015 (r288820) @@ -5103,6 +5103,13 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi ctl_set_reservation_conflict(ctsio); goto bailout; } + + /* SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior. */ + if (lun->flags & CTL_LUN_PR_RESERVED) { + ctl_set_success(ctsio); + goto bailout; + } + lun->flags |= CTL_LUN_RESERVED; lun->res_idx = residx; ctl_set_success(ctsio); @@ -7626,7 +7633,8 @@ retry: res_cap = (struct scsi_per_res_cap *)ctsio->kern_data_ptr; scsi_ulto2b(sizeof(*res_cap), res_cap->length); - res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_5; + res_cap->flags1 = SPRI_CRH; + res_cap->flags2 = SPRI_TMV | SPRI_ALLOW_5; type_mask = SPRI_TM_WR_EX_AR | SPRI_TM_EX_AC_RO | SPRI_TM_WR_EX_RO |