lkml.org 
[lkml]   [2017]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: News UBSAN warnings in aacraid
On Tue, Nov 28, 2017 at 2:05 PM, Meelis Roos <mroos@linux.ee> wrote:
>> I think this chunk would solve the problem and result in the
>> same behavior as before:
>>
>> --- a/drivers/scsi/aacraid/commsup.c
>> +++ b/drivers/scsi/aacraid/commsup.c
>> @@ -2511,8 +2511,8 @@ int aac_command_thread(void *data)
>> /* Synchronize our watches */
>> if (((NSEC_PER_SEC - (NSEC_PER_SEC / HZ)) > now.tv_nsec)
>> && (now.tv_nsec > (NSEC_PER_SEC / HZ)))
>> - difference = (((NSEC_PER_SEC -
>> now.tv_nsec) * HZ)
>> - + NSEC_PER_SEC / 2) / NSEC_PER_SEC;
>> + difference = HZ + HZ / 2 -
>> + now.tv_nsec / (NSEC_PER_SEC / HZ);
>> else {
>> if (now.tv_nsec > NSEC_PER_SEC / 2)
>> ++now.tv_sec;
>>
>> but I don't see why we add in half a second here. Any ideas?
>
> I did not try to understand the details but I can confirm that this
> patch makes the warnings go away.

Thanks for testing! I've wrote it up as a proper patch now, and tried
to capture what I understand about this code and how I got to
the new change.

Arnd

\
 
 \ /
  Last update: 2017-11-28 14:28    [W:0.056 / U:1.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site