ports/sysutils/diskcheckd (Re: bad sector in gmirror HDD)

Chris Rees utisoft at gmail.com
Thu Aug 25 17:55:15 UTC 2011


On 24 August 2011 16:14,  <perryh at pluto.rain.com> wrote:
>> When the specified or calculated rate exceeds 64KB/sec, the
>> required sleep interval between 64KB chunks is less than one
>> second.  Since diskcheckd calculates the interval in whole seconds
>> -- because it calls sleep() rather than usleep() or nanosleep()
>> -- an interval of less than one second is calculated as zero ...
>> I suspect the fix will be to calculate in microseconds, and call
>> usleep() instead of sleep().
>
> I think I may have this fixed.
>
> Could one of you try the attached patch?  I'm especially interested
> to see if this also clears up the issues reported as connected with
> gmirror (http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/143566),
> since I haven't been able to reproduce that part here.
>
> Summary of changes:
>
> * Calculate delays in microseconds, so that delays of less than
>  one second between reads (needed to implement rates exceeding
>  64KB/sec) do not get rounded down to zero.
>
> * Fix a reinitialization problem when handling SIGHUP.
>
> * Additional debug messages (only with -d).
>
> * Comment and manpage improvememts.
>

Hi Perry,

The changes look good, so if there's no response for a few days I'll
commit the changes.

Thanks for rescuing the port :)

Chris

-- 
Chris Rees          | FreeBSD Developer
crees at FreeBSD.org   | http://people.freebsd.org/~crees


More information about the freebsd-ports mailing list