From owner-svn-src-head@freebsd.org Thu Mar 5 16:33:54 2020 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 CB62926DF43; Thu, 5 Mar 2020 16:33:54 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48YGXd2hH6z46nf; Thu, 5 Mar 2020 16:33:53 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 025GXou3033311 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 5 Mar 2020 08:33:50 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 025GXoE5033310; Thu, 5 Mar 2020 08:33:50 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 5 Mar 2020 08:33:50 -0800 From: Gleb Smirnoff To: Dimitry Andric Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r358655 - head/sbin/mount_nfs Message-ID: <20200305163350.GU5741@FreeBSD.org> References: <202003042227.024MRGsW072613@repo.freebsd.org> <244e28ea-1217-cefc-354e-02ecb201637a@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <244e28ea-1217-cefc-354e-02ecb201637a@FreeBSD.org> X-Rspamd-Queue-Id: 48YGXd2hH6z46nf X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.07 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.99)[-0.989,0]; NEURAL_SPAM_MEDIUM(0.92)[0.917,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 05 Mar 2020 16:33:54 -0000 On Thu, Mar 05, 2020 at 03:29:23PM +0100, Dimitry Andric wrote: D> On 2020-03-04 23:27, Gleb Smirnoff wrote: D> > Author: glebius D> > Date: Wed Mar 4 22:27:16 2020 D> > New Revision: 358655 D> > URL: https://svnweb.freebsd.org/changeset/base/358655 D> > D> > Log: D> > When a machine boots the NFS mounting script is executed after D> > interfaces are configured, but for many interfaces (e.g. all Intel) D> > ifconfig causes link renegotiation, so the first attempt to mount D> > NFS always fails. After that mount_nfs sleeps for 30 seconds, while D> > only a couple seconds are actually required for interface to get up. D> > Instead of sleeping, do select(2) on routing socket and check if D> > some interface became UP and in this case retry immediately. D> D> At least on i386, this causes a -Werror warning: D> D> sbin/mount_nfs/mount_nfs.c:549:10: error: cast from 'char *' to 'struct D> if_msghdr *' increases required alignment from 1 to 4 D> [-Werror,-Wcast-align] D> ifm = (struct if_msghdr *)buf; D> ^~~~~~~~~~~~~~~~~~~~~~~ D> 1 error generated. D> D> In practice I don't think the buffer can ever get misaligned, so can you D> please add a NO_WCAST_ALIGN= to the Makefile? route(8) handles the same problem via intermediate (void *) cast. What is preferred way to solve the problem? Change compiler flags file wide, or just through (void *) cast? -- Gleb Smirnoff