From owner-svn-src-head@freebsd.org Thu Aug 8 14:00:20 2019 Return-Path: Delivered-To: svn-src-head@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 D14B3CF79E for ; Thu, 8 Aug 2019 14:00:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46494N396Xz4MdN for ; Thu, 8 Aug 2019 14:00:20 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1565272819; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=kNDfYDUuioWp52cQcKSHJgpZsYgrFfptxia47iVxYGWhQTgQnhDStfAfjl7I4wunrB61Gw6V/qH75 fl2MsclPsr7vDFGjQYb16p2Zurvfsi0wwDLm6BN0KUg3cvg0ohtQLE/hJAthC2bqUO8BUNTKFS3J9R WRCBwMp1NlJb/lks7eUKk0UXaSb3Btoj9tNALvocRNHjFt5pKfwaaPM5GnXlmvdVtm0WteWNlGf/Mn EXuzlmodlfbHbJKps+ceR0Jl47Rg9FrXwO6uRhuvVamdkFMVbtmGPsO1uDNAkwUCss+owuIrAOGGWb /I/BLk3G9PMsYUu6ySGsMbV7TJHWgEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=8rC1AucEIp4ciCDtGzcTDhCSqgg78EwPkcKyjdoqtq4=; b=IsPPSJsQtUWXtdve4c3YJTPvvPzAks9JvPfR9n9lj/ryDv9aPbvPoC4NCP6mED7KmGg62HVMn1e8T MpYG6cWWVImJhdh6uuNlmFt3cTlra4ROOSXMKoWRlxzdEKR/EJZe/V8/+5TTqWX5RLbp4pqLWBZu1y GjkMYdn4Oke/GnSAqcy/+83OOT1zjykylHD+S37Wg8JcW7njzPXYT5bQ1tMvWSgJ6kpEgvHEtYahha dwb0wub4LGj7sVQrbMS8JShgbmXed8hEZP8HJEepum5dubF5v5qSeP3SxVbZlNC2Exm8OFTDPsMezS x+KdhXCGRgGQqzDwe2C39wYEgOSFosQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=8rC1AucEIp4ciCDtGzcTDhCSqgg78EwPkcKyjdoqtq4=; b=t3fcHj75oKoltBhmZEQvkP612M2tgX0EAwAhTSU9OEdL9LWUd0ASGztNkTFnLFSJivpuHSsvLDy8D Xduj35NSSy3g0tizVIPhnmybDHAZc+AvXl7/HOhOy8UMCAMtelBWiJBG4/JBZK0zKbzmw+oYVaq364 F6qZq/cz5YVA/TKNbtj5kQrj/SZi2NrAZlyvnXs/4QdgMghb74Txtd0HzB3s+pH4yJgFDZc4i6ii1g baFcyYtgtn4DfsR59HiKQN0U9VoO5pO91gWut6LUKcH+t7YHwB3SZtUjmRCfFSzoy1+F9yz328pYjx IGEeGpZ7cY9QCEgJw7sYwUtg9rHPy7g== X-MHO-RoutePath: aGlwcGll X-MHO-User: d99b2772-b9e4-11e9-85ec-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id d99b2772-b9e4-11e9-85ec-13b9aae3a1d2; Thu, 08 Aug 2019 14:00:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x78E0GE1029727; Thu, 8 Aug 2019 08:00:16 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <53d227e7f8535424c3abff229a41e9375b077dcc.camel@freebsd.org> Subject: Re: svn commit: r350737 - head/usr.sbin/autofs From: Ian Lepore To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 08 Aug 2019 08:00:16 -0600 In-Reply-To: <201908080316.x783GW3r070041@repo.freebsd.org> References: <201908080316.x783GW3r070041@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46494N396Xz4MdN X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 14:00:20 -0000 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