Fix "camcontrol rescan" with SATA drives behind a SAS controller

A bug in CAM's serial number hash logic resulted in SATA drives behind a SAS
controller getting removed and readded anytime the drive was rescanned for
any reason.

PR:		212914
Submitted by:	kadesai
Reported by:	kadesai
Reviewed by:	asomers, ken
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
This commit is contained in:
Alan Somers 2016-11-17 20:42:56 +00:00
parent 240e239505
commit 2edc027cf0

View File

@ -1626,8 +1626,8 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
sizeof(struct scsi_inquiry_data)); sizeof(struct scsi_inquiry_data));
if (have_serialnum) if (have_serialnum)
MD5Update(&context, serial_buf->serial_num, MD5Update(&context, path->device->serial_num,
serial_buf->length); path->device->serial_num_len);
MD5Final(digest, &context); MD5Final(digest, &context);
if (bcmp(softc->digest, digest, 16) == 0) if (bcmp(softc->digest, digest, 16) == 0)