Return-Path: Subject: Re: [PATCH] Fix overflow in percentile calculation for Windows References: <20171010212710.12526-1-andrzej.jakowski@intel.com> <28cd47ad-913c-0eaa-ec2d-84ab47763029@gmail.com> <79c9569e-707c-6cd8-2bc0-2e774e09448f@kernel.dk> From: Jens Axboe Message-ID: Date: Sat, 14 Oct 2017 09:56:20 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit To: Sitsofe Wheeler Cc: Andrzej Jakowski , Vincent Fu , "fio@vger.kernel.org" , Andrzej Jakowski List-ID: On 10/12/2017 02:51 PM, Sitsofe Wheeler wrote: > On 12 October 2017 at 15:36, Jens Axboe wrote: >> >> Just go through them one-by-one. I think some of these were likely >> introduced with the nsec conversion, which I guess isn't too >> surprising... > > With all the latest patches applied these are the only warnings which > look faintly legitimate: > > io_u.c:1272:28: runtime error: unsigned integer overflow: 0 - 1 cannot > be represented in type 'unsigned int' > > Might be harmless because we goto out just after td->file_service_left > has wrapped around. Might be worth it to clean up, I'll do that. > ioengines.c:270:22: runtime error: unsigned integer overflow: 59 - 63 > cannot be represented in type 'unsigned int' > > It does look like td->io_u_in_flight is over decremented but it's not > clear how I/Os that weren't already in flight somehow completed... Hmm that is odd. I'll look into that. > stat.c:1529:20: runtime error: unsigned integer overflow: 3370715872 + > 1125639672 cannot be represented in type 'unsigned int' > stat.c:1531:23: runtime error: unsigned integer overflow: 3370715859 + > 1125639668 cannot be represented in type 'unsigned int' > stat.c:1533:25: runtime error: unsigned integer overflow: 3370715862 + > 1125639669 cannot be represented in type 'unsigned int' > > The last three are all down to io_u_* structure members being 32 bit. > Would we want to make them 64 bit and bump the protocol version? Yes, I think we should make them 64-bit and just bump the protocol version. -- Jens Axboe