From owner-freebsd-fs@FreeBSD.ORG Tue Feb 1 11:17:57 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 2A1D9106564A for ; Tue, 1 Feb 2011 11:17:57 +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 AF7CB8FC1C for ; Tue, 1 Feb 2011 11:17:56 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id CAF1B139977; Tue, 1 Feb 2011 12:17:55 +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 AGOTCtC1xHw9; Tue, 1 Feb 2011 12:17:53 +0100 (CET) Received: from [10.9.8.3] (chello085216231078.chello.sk [85.216.231.78]) by mail.vx.sk (Postfix) with ESMTPSA id 6AD66139965; Tue, 1 Feb 2011 12:17:53 +0100 (CET) Message-ID: <4D47EBE0.8090208@FreeBSD.org> Date: Tue, 01 Feb 2011 12:17:52 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Artem Belevich References: <4D443407.7010604@FreeBSD.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------090109010904010807040702" 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: Tue, 01 Feb 2011 11:17:57 -0000 This is a multi-part message in MIME format. --------------090109010904010807040702 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Please try the attached patch. Thanks, mm 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 --------------090109010904010807040702 Content-Type: text/x-patch; name="zfs_clock_t.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="zfs_clock_t.patch" Index: sys/cddl/compat/opensolaris/sys/types.h =================================================================== --- sys/cddl/compat/opensolaris/sys/types.h (revision 218166) +++ sys/cddl/compat/opensolaris/sys/types.h (working copy) @@ -34,6 +34,10 @@ */ #include + +typedef int64_t clock_t; +#define _CLOCK_T_DECLARED + #include_next #define MAXNAMELEN 256 --------------090109010904010807040702--