From 2edc027cf0ab9c58d2778c54937f5cabeac4f233 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Thu, 17 Nov 2016 20:42:56 +0000 Subject: [PATCH] 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 --- sys/cam/scsi/scsi_xpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index ddb565830ae0..cb7205e3331b 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1626,8 +1626,8 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) sizeof(struct scsi_inquiry_data)); if (have_serialnum) - MD5Update(&context, serial_buf->serial_num, - serial_buf->length); + MD5Update(&context, path->device->serial_num, + path->device->serial_num_len); MD5Final(digest, &context); if (bcmp(softc->digest, digest, 16) == 0)