From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbdK1NFo (ORCPT ); Tue, 28 Nov 2017 08:05:44 -0500 Received: from smtp1.it.da.ut.ee ([193.40.5.66]:52909 "EHLO smtp1.it.da.ut.ee" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbdK1NFn (ORCPT ); Tue, 28 Nov 2017 08:05:43 -0500 Date: Tue, 28 Nov 2017 15:05:38 +0200 (EET) From: Meelis Roos To: Arnd Bergmann cc: Dave Carroll , "Martin K. Petersen" , linux-scsi , Linux Kernel list Subject: Re: News UBSAN warnings in aacraid In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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. -- Meelis Roos (mroos@linux.ee)