smartctl likes to read SMART data into 512 byte buffers which it allocates on the stack. While this _should_ work just fine, I have found that sometimes, when using SATA over SAS (-d sat) with an MPT Fusion HBA, smartctl's buffer gets broken into 2 Scatter Gather Elements (probably because the 512 byte buffer stradles a page boundary). Sometimes, only the first of these gets filled before the mpt driver records a timeout and subsequently resets the SAS bus.
I have not fully diagnosed the problem or had time to write a sample code'let that can reproduce it. But in the mean time, this patch moves the data buffer from the stack to the heap where it will be aligned to avoid a page boundary.
Hopefully I will have time to diagnose the real problem and either fix it (if it's in the driver) or send in a bug report to LSI (if it's in the MPT controller).
Fix: Attached is a patch to the port that adds a patch that makes shure the data buffers used to read smart attributes and logs do not straddle page boundaries.
Patch attached with submission follows:
How-To-Repeat: pray. Then on a 64bit system, with an 8gig LSI MPT SAS controler
Mpi Version 184.108.40.206
or FWVersion 220.127.116.11
connected to a SATA drive, turn on all available debugging in CAM and the MPT driver.
run smartctl -d sat -r ioctl -a /dev/da<foo>
sometimes, if you're 'lucky', you'll see a bus reset, and smartcl will fail to get some of it's SMART data.
Over to maintainer (via the GNATS Auto Assign Tool)
Looks ok, please commit (PORTREVISION bump required too).
I'll take it.
avl 2009-09-11 13:41:59 UTC
FreeBSD ports repository
- Add a patch that makes shure the data buffers used to read smart
attributes and logs do not straddle page boundaries
Submitted by: Brad Huntting <huntting AT glarp.com>
Approved by: tabthorpe, glarkin (mentors, implicit), marck (maintainer)
Revision Changes Path
1.43 +2 -2 ports/sysutils/smartmontools/Makefile
1.1 +22 -0 ports/sysutils/smartmontools/files/patch-scsiata.cpp (new)
email@example.com mailing list
To unsubscribe, send any mail to "firstname.lastname@example.org"