[Bug 212914] CAM: SATA drives are getting deleted and then re-added after controller rescan

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Oct 18 09:17:19 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212914

--- Comment #4 from Kashyap <kashyap.desai at broadcom.com> ---
This issue is fixed using below patch. Please review and let me know if this is
a correct fix.  Root cause is - "Checksum is updated using different serial
number. One without removing extra spaces and another with additional spaces.
Because of that, any rescan of ATA disk is defected as different ATA drive, so
it is removed and re-added later. "


Index: scsi_xpt.c
===================================================================
--- scsi_xpt.c  (revision 307137)
+++ scsi_xpt.c  (working copy)
@@ -1600,8 +1600,8 @@
                                  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)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list