From owner-svn-src-head@freebsd.org Thu Mar 5 17:25:06 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 284FC26EE21; Thu, 5 Mar 2020 17:25:06 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48YHgh15Rjz3FWh; Thu, 5 Mar 2020 17:25:03 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1j9uEw-0003ZG-7Y; Thu, 05 Mar 2020 20:24:54 +0300 Date: Thu, 5 Mar 2020 20:24:54 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Cc: Dimitry Andric , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r358655 - head/sbin/mount_nfs Message-ID: <20200305172454.GJ8028@zxy.spb.ru> References: <202003042227.024MRGsW072613@repo.freebsd.org> <244e28ea-1217-cefc-354e-02ecb201637a@FreeBSD.org> <20200305163350.GU5741@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200305163350.GU5741@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 48YHgh15Rjz3FWh X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.20 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_SPAM_MEDIUM(0.80)[0.800,0] 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 17:25:06 -0000 On Thu, Mar 05, 2020 at 08:33:50AM -0800, Gleb Smirnoff wrote: > 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? Copy to aligned buffer or got SIGBUS on some architectures?