Date: Thu, 5 Mar 2020 20:35:15 +0300 From: Slawa Olhovchenkov <slw@zxy.spb.ru> To: Gleb Smirnoff <glebius@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric <dim@freebsd.org> Subject: Re: svn commit: r358655 - head/sbin/mount_nfs Message-ID: <20200305173515.GK8028@zxy.spb.ru> In-Reply-To: <20200305172454.GJ8028@zxy.spb.ru> References: <202003042227.024MRGsW072613@repo.freebsd.org> <244e28ea-1217-cefc-354e-02ecb201637a@FreeBSD.org> <20200305163350.GU5741@FreeBSD.org> <20200305172454.GJ8028@zxy.spb.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 05, 2020 at 08:24:54PM +0300, Slawa Olhovchenkov wrote: > 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? char buf[2048] __aligned(__alignof(struct if_msghdr)); resolve this watning.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200305173515.GK8028>