Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Oct 2016 09:17:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 212914] CAM: SATA drives are getting deleted and then re-added after controller rescan
Message-ID:  <bug-212914-8-E8Ze7ns14e@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-212914-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-212914-8@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

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

--- Comment #4 from Kashyap <kashyap.desai@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.

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212914-8-E8Ze7ns14e>