From owner-freebsd-arm@freebsd.org Thu Aug 10 15:51:35 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A8D4DD6628 for ; Thu, 10 Aug 2017 15:51:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 0F51B66841 for ; Thu, 10 Aug 2017 15:51:34 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a844b002-7de3-11e7-a4a1-c9e62e5d9688 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id a844b002-7de3-11e7-a4a1-c9e62e5d9688; Thu, 10 Aug 2017 15:50:39 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v7AFpQeq003833; Thu, 10 Aug 2017 09:51:26 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1502380286.50720.97.camel@freebsd.org> Subject: Re: Question on mountd From: Ian Lepore To: Olavi Kumpulainen , freebsd-arm@freebsd.org Date: Thu, 10 Aug 2017 09:51:26 -0600 In-Reply-To: References: Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Aug 2017 15:51:35 -0000 On Thu, 2017-08-10 at 16:56 +0200, Olavi Kumpulainen wrote: > Hi guys, > > I notice that mount SIGHUP¢s mountd every time mount succeeds. The > SIGHUP causes mountd to remount all exported directories.If this > happens while a NFS-client is accessing a share, an access error may > occur. > For this purpose, there is an option to mount, -S, which locks nfsd > while the remount is executing. > > Can anyone of you share why mount needs to SIGHUP mountd in the first > place? It would make sense if mountd is restarted whenever > /etc/exports is modified, but always seems like overkill. > Based on looking through the mountd code a bit... When a new filesystem is mounted, it may be mounted on one of the mount points listed in /etc/exports.  If there was no fs mounted there previously, then mountd might have failed to set the in-kernel export attributes the last time it processed the exports file, so it has to do the processing again after the mount to update the in-kernel export data.  It would be really complex for mountd to try to figure out the minimal set of "what changed" after a mount succeeds, so it just completely reprocesses the exports file, first removing all export data from the kernel, then re- applying it all. So, all in all, I think the right fix for this is to add "mountd_flags="-r -S" to your rc.conf file (-r is a default from /etc/defaults/rc.conf). -- Ian