Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Oct 2010 23:22:09 -0600
From:      Scott Long <scottl@samsco.org>
To:        Mark Johnston <mjohnston@sandvine.com>
Cc:        "freebsd-scsi@freebsd.org" <freebsd-scsi@freebsd.org>
Subject:   Re: [Patch] camcontrol - determine the defect list length
Message-ID:  <DD4C1CD8-FE86-429A-AF9A-26DD81DF7D49@samsco.org>
In-Reply-To: <649630C24D5E884F85DD13645FE903A7640B244F@wtl-exch-2.sandvine.com>
References:  <649630C24D5E884F85DD13645FE903A7640B244F@wtl-exch-2.sandvine.com>

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

On Oct 25, 2010, at 9:55 AM, Mark Johnston wrote:

> Hi,
>=20
> Below is a patch for camcontrol from the tree at my work. It was =
introduced several years ago to resolve some issues that we were seeing =
in Adaptec's RAID controller firmware. The change is to the =
readdefects() function - when sending the request to read the defect =
list, instead of using a 65000-entry buffer, we wrote a new function to =
query the drive and determine the size of the defect list before =
allocating any memory. Apparently, if we send a maximum length longer =
than the number of bytes in the defect list, the cam call returns an =
overflow error due to what is probably a firmware bug.
>=20
> It's probable that this issue has been fixed in Adaptec's firmware for =
a while now, and that this change is no longer necessary to us. However, =
it's conceivable that other devices could have the same problem, and as =
far as I can see, this patch shouldn't introduce any regressions - it =
essentially consists of sending an additional CAM request before getting =
the defect list.
>=20
> I'd like to know whether this patch is worth trying to get committed =
into FreeBSD. If anyone has some comments or suggestions on the patch, =
I'd highly appreciate it.
>=20

Should the whole operation of reading the defect list abort if =
readdefectlen() fails, or should it just fall back to a modest length =
and try the operation anyways?  Also, if readdefectlen() succeeds, how =
do the defect_list and ccb get freed?

Scott





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DD4C1CD8-FE86-429A-AF9A-26DD81DF7D49>