From owner-svn-src-all@freebsd.org Thu Aug 8 15:46:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 487F6A9EA9; Thu, 8 Aug 2019 15:46:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464CR01B3bz4Th6; Thu, 8 Aug 2019 15:46:35 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-ot1-x344.google.com with SMTP id n5so120497015otk.1; Thu, 08 Aug 2019 08:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8OD/tFb2EeDF0jwqBWeX0y9j7ssUHU9/YhFfBWTeDNE=; b=iHbyFYAL5MuGoAhQHvId99a8SMOVhsFTpWfbgCZx34fkDzw9mg32FfRsOiIg5Q+wKF Eq/cUE6TBJV9j5mGA0d7h94SJBsuFtaf06rSJnBHaNb02amd8rXJAm/Vp9uKT5l47hdb wkWk6QvlfEZ9lXaxJu+7MKCaqrm1tiCIlOytZKPhT9TkinE9oMQwLUtUN9tS+iDirA8/ bCDHesm9e4GKVJ2EugtbI6SaeB7OwVwhXIPzq1IM69BoRmsKuwU4nH6rJ2j6tPuoi8Lq r2bXN0C6tLQdU4JuizQJYpihqDUSSTk6DUr9ZCEEP9x2iMDgO17LHDReylRHgfKiwLOv QqJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8OD/tFb2EeDF0jwqBWeX0y9j7ssUHU9/YhFfBWTeDNE=; b=ITylBAU12bKzSnoyq/O2UgpC3ZGOAwCCgS1dNIy84MwYjAlZn2z9YuT00mOtllMZTf TeJF09L+kGFkdZvZeo4Gmh4tpKMjAmYGDLUwqZAyIZkfQhBkZz9MBtIiomz77aEY41q9 lLKb8W9mYVwjrlwRx9X+0D3mQjrnlYBz6TnnsVrLjC0t+5Xe2xVfkBtcqHqmTgvZh60a T040rLhWSlsjXqo0tDKZXo4x1o66LsqfQ9yP785NaxHihqZBDn735yrI0CPiIti6rFjC z4hdnGrg3XLofPgieiIg+eOQLXJdn8fApFymmyzeyJTB6LXnotnZkkh2e3B1pCS/pVaw a6xg== X-Gm-Message-State: APjAAAWnG3WZ78sdCWg04xdDZD+EwQrMtgRdF8bQdWkGIcORpBE872qg TO9vnU5sV+LrW7DAWG0iwtBWNGbZprQ= X-Google-Smtp-Source: APXvYqxZf+vRWTYRIK46N3VGjytKl5fRL6ncawPFrUMRW1zVCfOOl5AzGCGmUYq83iJJLHBpfp8Cag== X-Received: by 2002:a6b:b804:: with SMTP id i4mr4243190iof.205.1565279194051; Thu, 08 Aug 2019 08:46:34 -0700 (PDT) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id l6sm5376466ioc.15.2019.08.08.08.46.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 08:46:33 -0700 (PDT) Sender: Justin Hibbits Date: Thu, 8 Aug 2019 10:46:29 -0500 From: Justin Hibbits To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350737 - head/usr.sbin/autofs Message-ID: <20190808104629.405a5c0b@ralga.knownspace> In-Reply-To: <53d227e7f8535424c3abff229a41e9375b077dcc.camel@freebsd.org> References: <201908080316.x783GW3r070041@repo.freebsd.org> <53d227e7f8535424c3abff229a41e9375b077dcc.camel@freebsd.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 464CR01B3bz4Th6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 15:46:36 -0000 On Thu, 08 Aug 2019 08:00:16 -0600 Ian Lepore wrote: > On Thu, 2019-08-08 at 03:16 +0000, Justin Hibbits wrote: > > Author: jhibbits > > Date: Thu Aug 8 03:16:32 2019 > > New Revision: 350737 > > URL: https://svnweb.freebsd.org/changeset/base/350737 > > > > Log: > > Change autounmountd(8) to use time_t for duration instead of > > double > > Summary: > > autounmountd(8) uses doubles to handle mount time durations. > > However, it must convert to integer types, time_t in particular, to > > do anything meaningful. Additionally, even though it's a > > floating-point value in seconds, the sub-seconds component is never > > used, so it's unnecessary. > > Switching type to time_t fixes an assertion on powerpc64, which > > checks that a sleep value that's not -1.0 is greater than 0. On > > powerpc64, it happens that the value of -1.0 gets loaded as a float > > (perhaps a bug in gcc), but gets compared to a double. This > > compares as false, so follows through the 'sleep != -1.0' path, and > > fails the assert. Since the sub-second component isn't used in the > > double, just drop it and deal with whole-integer seconds. > > > > Reviewed by: trasz > > Differential Revision: https://reviews.freebsd.org/D21109 > > > > Modified: > > head/usr.sbin/autofs/autounmountd.c > > > > Modified: head/usr.sbin/autofs/autounmountd.c > > ============================================================================== > > --- head/usr.sbin/autofs/autounmountd.c Thu Aug 8 03:01:35 > > 2019 (r350736) +++ > > head/usr.sbin/autofs/autounmountd.c Thu Aug 8 03:16:32 > > 2019 (r350737) @@ -179,12 +179,12 @@ unmount_by_fsid(const > > fsid_t fsid, const char *mountpo return (error); } > > > > -static double > > -expire_automounted(double expiration_time) > > +static time_t > > +expire_automounted(time_t expiration_time) > > { > > struct automounted_fs *af, *tmpaf; > > time_t now; > > - double mounted_for, mounted_max = -1.0; > > + time_t mounted_for, mounted_max = -1; > > int error; > > > > now = time(NULL); > > @@ -196,9 +196,9 @@ expire_automounted(double expiration_time) > > > > if (mounted_for < expiration_time) { > > log_debugx("skipping %s (FSID:%d:%d), > > mounted " > > - "for %.0f seconds", af->af_mountpoint, > > + "for %ld seconds", af->af_mountpoint, > > > > You can't print a time_t with %ld, it'll fail on 32-bit arches with > 64- bit time_t. The usual incantation is %j and cast to intmax_t. > > -- Ian > > I cast it to a long already, so it prints as a long for all archs. I guess intmax_t might be better, but I figured nobody would hold a mount for more than 2**31 seconds (the argument is for duration, not absolute time). - Justin