From owner-freebsd-fs@FreeBSD.ORG Sun Jan 30 23:25:19 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43A9A106564A for ; Sun, 30 Jan 2011 23:25:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:100:1043::3]) by mx1.freebsd.org (Postfix) with ESMTP id CD3D68FC1D for ; Sun, 30 Jan 2011 23:25:18 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id E34C8F2DC7; Mon, 31 Jan 2011 00:25:17 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nVGFsQnRxVCU; Mon, 31 Jan 2011 00:25:15 +0100 (CET) Received: from [10.9.8.134] (chello085216231078.chello.sk [85.216.231.78]) by mail.vx.sk (Postfix) with ESMTPSA id B754DF2DC0; Mon, 31 Jan 2011 00:25:15 +0100 (CET) Message-ID: <4D45F359.4040402@FreeBSD.org> Date: Mon, 31 Jan 2011 00:25:13 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Artem Belevich References: <4D443407.7010604@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-fs Subject: Re: ZFS: clock_t overflow in l2arc_feed_thread X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2011 23:25:19 -0000 I have re-checked OpenSolaris, and discovered that long is a int32_t. I agree, we should go for int64_t in our case. Dňa 29.01.2011 20:06, Artem Belevich wrote / napísal(a): > On Sat, Jan 29, 2011 at 7:36 AM, Martin Matuska wrote: >> I agree to you that we have different types and this may be an issue but >> I disagree to your patch. >> clock_t is not signed (int64_t) and this can be done in a much easier >> (and cleaner way) without touching the code, see attached patch. > > I like the minimalism of your patch. > > It should fix the overflow on LP64, but it would still be there on > i386. To avoid this particular problem we need int64_t even on 32-bit > platforms. Either that, or we should change the way we emulate > solaris' LBOLT in FreeBSD. > > Another concern I have is with this patch we'll end up with parts of > kernel compiled with 32-bit clock_t and other parts build with 64-bit > clock_t. If someone passes a pointer to clock_t between these two > classes of code, we'll have a problem. > > --Artem