Date: Thu, 8 Jan 2015 16:27:57 +0000 (UTC) From: "Kenneth D. Merry" <ken@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276831 - head/sys/cam/scsi Message-ID: <201501081627.t08GRvS7062049@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ken Date: Thu Jan 8 16:27:56 2015 New Revision: 276831 URL: https://svnweb.freebsd.org/changeset/base/276831 Log: Fix a bug in the CAM SCSI probe code that caused changes in inquiry data to go undetected. The probe code does an MD5 checksum of the inquiry data (and page 0x80 serial number if available) before doing a reprobe of an existing device, and then compares a checksum after the probe to see whether the device has changed. This check was broken in January, 2000 by change 56146 when the extended inquiry probe code was added. In the extended inquiry probe case, it was calculating the checksum a second time. The second time it included the updated inquiry data from the short inquiry probe (first 36 bytes). So it wouldn't catch cases where the vendor, product, revision, etc. changed. This change will have the effect that when a device's inquiry data is updated and a rescan is issued, it will disappear and then reappear. This is the appropriate action, because if the inquiry data or serial number changes, it is either a different device or the device configuration may have changed significantly. (e.g. with updated firmware.) scsi_xpt.c: Don't calculate the initial MD5 checksum on standard inquiry data and the page 0x80 serial number if we have already calculated it. MFC after: 1 week Sponsored by: Spectra Logic Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Jan 8 16:13:21 2015 (r276830) +++ head/sys/cam/scsi/scsi_xpt.c Thu Jan 8 16:27:56 2015 (r276831) @@ -755,7 +755,8 @@ again: * serial number check finish, we attempt to figure out * whether we still have the same device. */ - if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { + if (((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) + && ((softc->flags & PROBE_INQUIRY_CKSUM) == 0)) { MD5Init(&softc->context); MD5Update(&softc->context, (unsigned char *)inq_buf,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501081627.t08GRvS7062049>