From owner-freebsd-fs@FreeBSD.ORG Sat Jan 29 19:06:37 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 874E11065670; Sat, 29 Jan 2011 19:06:37 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id E02FB8FC08; Sat, 29 Jan 2011 19:06:36 +0000 (UTC) Received: by bwz12 with SMTP id 12so4284270bwz.13 for ; Sat, 29 Jan 2011 11:06:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=QfBrEKpzjgCloH2uRaJEgk58MtFIVuCqJm8g4aGL/jM=; b=K9B+p+cMbeNepwamVKyQ3w5kKVMO7wSpF81ZveTyJebNFGkk+u0MqH/1xUbRaO9oie 7Jirs+wsTWmCjWR4RkgWLD1mmaXIyZQ2SV0oruWsJpXiS1MoJA+6j2pucJZ1aN+a4MkV 64mt3TttMJEG6Pxgea3qp+pzeUKA1EPA2kuAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=txmPUYRflSkd8tWybzma+DU8u6vuDF3/wtv1Vo+MUcvPlArqTZGp+Lz+LYsh/Nrc2N ByYw3UTZUbdrHt7aNTwmC58sJOTRrbB0rFPMeQpezu1EX3dY2LUzgZ7jZpPaOZFegosY pBRJpdH+40W5ceTo3WL27a4YMD/c0h/QR2hYA= MIME-Version: 1.0 Received: by 10.204.33.73 with SMTP id g9mr3658166bkd.157.1296327995606; Sat, 29 Jan 2011 11:06:35 -0800 (PST) Sender: artemb@gmail.com Received: by 10.204.49.13 with HTTP; Sat, 29 Jan 2011 11:06:35 -0800 (PST) In-Reply-To: <4D443407.7010604@FreeBSD.org> References: <4D443407.7010604@FreeBSD.org> Date: Sat, 29 Jan 2011 11:06:35 -0800 X-Google-Sender-Auth: q7srke4mrqGQ2xyVVxtL4gJIAow Message-ID: From: Artem Belevich To: Martin Matuska Content-Type: text/plain; charset=ISO-8859-1 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: Sat, 29 Jan 2011 19:06:37 -0000 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