Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2015 10:45:34 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r288779 - stable/10/sys/cam/ctl
Message-ID:  <201510051045.t95AjYfQ072992@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Oct  5 10:45:33 2015
New Revision: 288779
URL: https://svnweb.freebsd.org/changeset/base/288779

Log:
  MFC r287994: Always execute REPORT LUNS and REQUEST SENSE commands locally.
  
  REPORT LUNS command is more related to target rather then specific LUN.
  This node may be primary for LUNs for some reason unknown to another,
  and command forwarded to another node won't be able to report them.
  
  REQUEST SENSE is related to LUN, but in our implementation it reports
  only UAs and CAs, that are stored locally rather then on primary node.

Modified:
  stable/10/sys/cam/ctl/ctl.c
  stable/10/sys/cam/ctl/ctl_cmd_table.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 10:44:36 2015	(r288778)
+++ stable/10/sys/cam/ctl/ctl.c	Mon Oct  5 10:45:33 2015	(r288779)
@@ -11267,7 +11267,8 @@ ctl_scsiio_precheck(struct ctl_softc *so
 	 * side so when we are done we can find the copy.
 	 */
 	if ((lun->flags & CTL_LUN_PRIMARY_SC) == 0 &&
-	    (lun->flags & CTL_LUN_PEER_SC_PRIMARY) != 0) {
+	    (lun->flags & CTL_LUN_PEER_SC_PRIMARY) != 0 &&
+	    (entry->flags & CTL_CMD_FLAG_RUN_HERE) == 0) {
 		union ctl_ha_msg msg_info;
 		int isc_retval;
 

Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_cmd_table.c	Mon Oct  5 10:44:36 2015	(r288778)
+++ stable/10/sys/cam/ctl/ctl_cmd_table.c	Mon Oct  5 10:45:33 2015	(r288779)
@@ -554,7 +554,8 @@ const struct ctl_cmd_entry ctl_cmd_table
 				       CTL_CMD_FLAG_OK_ON_INOPERABLE |
 				       CTL_CMD_FLAG_OK_ON_STANDBY |
 				       CTL_CMD_FLAG_OK_ON_UNAVAIL |
-				       CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
+				       CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
+				       CTL_CMD_FLAG_RUN_HERE,
  CTL_LUN_PAT_NONE, 6, {0x01, 0, 0, 0xff, 0x07}},
 
 /* 04 FORMAT UNIT */
@@ -1174,7 +1175,8 @@ const struct ctl_cmd_entry ctl_cmd_table
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
 
 /* A0 REPORT LUNS */
-{ctl_report_luns, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_NO_LUN |
+{ctl_report_luns, CTL_SERIDX_INQ, CTL_FLAG_DATA_IN |
+				  CTL_CMD_FLAG_OK_ON_NO_LUN |
 				  CTL_CMD_FLAG_OK_ON_BOTH |
 				  CTL_CMD_FLAG_ALLOW_ON_RESV |
 				  CTL_CMD_FLAG_NO_SENSE |
@@ -1182,8 +1184,8 @@ const struct ctl_cmd_entry ctl_cmd_table
 				  CTL_CMD_FLAG_OK_ON_INOPERABLE |
 				  CTL_CMD_FLAG_OK_ON_STANDBY |
 				  CTL_CMD_FLAG_OK_ON_UNAVAIL |
-				  CTL_FLAG_DATA_IN |
-				  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
+				  CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
+				  CTL_CMD_FLAG_RUN_HERE,
  CTL_LUN_PAT_NONE,
  12, {0, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
 



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