Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 2013 20:43:01 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259108 - head/sys/cam/scsi
Message-ID:  <201312082043.rB8Kh2l1042110@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Dec  8 20:43:01 2013
New Revision: 259108
URL: http://svnweb.freebsd.org/changeset/base/259108

Log:
  When comparing device IDs, make sure that they have the same type
  (like NAA assigned) and identify the same entity (like device or port).
  Otherwise there can be false positives since at least some models of
  Seagate disks use same IDs for the whole device and one of its ports.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/scsi/scsi_all.c

Modified: head/sys/cam/scsi/scsi_all.c
==============================================================================
--- head/sys/cam/scsi/scsi_all.c	Sun Dec  8 20:07:02 2013	(r259107)
+++ head/sys/cam/scsi/scsi_all.c	Sun Dec  8 20:43:01 2013	(r259108)
@@ -6509,7 +6509,11 @@ scsi_devid_match(uint8_t *lhs, size_t lh
 		while (rhs_id <= rhs_last
 		    && (rhs_id->identifier + rhs_id->length) <= rhs_end) {
 
-			if (rhs_id->length == lhs_id->length
+			if ((rhs_id->id_type &
+			     (SVPD_ID_ASSOC_MASK | SVPD_ID_TYPE_MASK)) ==
+			    (lhs_id->id_type &
+			     (SVPD_ID_ASSOC_MASK | SVPD_ID_TYPE_MASK))
+			 && rhs_id->length == lhs_id->length
 			 && memcmp(rhs_id->identifier, lhs_id->identifier,
 				   rhs_id->length) == 0)
 				return (0);



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