svn commit: r285481 - head/sys/dev/isp

Alexander Motin mav at FreeBSD.org
Mon Jul 13 15:51:29 UTC 2015


Author: mav
Date: Mon Jul 13 15:51:28 2015
New Revision: 285481
URL: https://svnweb.freebsd.org/changeset/base/285481

Log:
  Make role sysctl handling from r284727 less strict.

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==============================================================================
--- head/sys/dev/isp/isp_freebsd.c	Mon Jul 13 15:46:01 2015	(r285480)
+++ head/sys/dev/isp/isp_freebsd.c	Mon Jul 13 15:51:28 2015	(r285481)
@@ -101,18 +101,15 @@ isp_role_sysctl(SYSCTL_HANDLER_ARGS)
 	ISP_LOCK(isp);
 	old = FCPARAM(isp, chan)->role;
 
+	/* We don't allow target mode switch from here. */
+	value = (old & ISP_ROLE_TARGET) | (value & ISP_ROLE_INITIATOR);
+
 	/* If nothing has changed -- we are done. */
 	if (value == old) {
 		ISP_UNLOCK(isp);
 		return (0);
 	}
 
-	/* We don't allow target mode switch from here. */
-	if ((value ^ old) & ISP_ROLE_TARGET) {
-		ISP_UNLOCK(isp);
-		return (EPERM);
-	}
-
 	/* Actually change the role. */
 	error = isp_control(isp, ISPCTL_CHANGE_ROLE, chan, value);
 	ISP_UNLOCK(isp);


More information about the svn-src-all mailing list