From owner-svn-src-head@freebsd.org Wed Feb 8 09:28:13 2017 Return-Path: Delivered-To: svn-src-head@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 E5D66CD5889; Wed, 8 Feb 2017 09:28:13 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EED229B; Wed, 8 Feb 2017 09:28:13 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-246-6.lns20.per4.internode.on.net [121.45.246.6]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v189S7i0012630 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 8 Feb 2017 01:28:11 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r313350 - head/sys/kern To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201702062036.v16Kaxbc061348@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Wed, 8 Feb 2017 17:28:02 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <201702062036.v16Kaxbc061348@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 08 Feb 2017 09:28:14 -0000 On 7/2/17 4:36 am, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Feb 6 20:36:59 2017 > New Revision: 313350 > URL: https://svnweb.freebsd.org/changeset/base/313350 > > Log: > In r290196 the root mount hold mechanism was changed to make it not wait > for mount hold release if the root device already exists. So, unless your > rootdev is not on USB - ie in the usual case - the root mount won't wait > for USB. However, the old behaviour was sometimes used as "wait until USB > is fully enumerated", and r290196 broke that. > > This commit adds vfs.root_mount_always_wait tunable, to force the kernel > to always wait for root mount holds, even if the root is already there. can we not add some more specific way to wait for enumeration? like a sysctl that counts number of enumerations completed? > > Reviewed by: kib > MFC after: 2 weeks > Relnotes: yes > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D9387 > > Modified: > head/sys/kern/vfs_mountroot.c > > Modified: head/sys/kern/vfs_mountroot.c > ============================================================================== > --- head/sys/kern/vfs_mountroot.c Mon Feb 6 18:44:15 2017 (r313349) > +++ head/sys/kern/vfs_mountroot.c Mon Feb 6 20:36:59 2017 (r313350) > @@ -132,6 +132,11 @@ static int root_mount_complete; > static int root_mount_timeout = 3; > TUNABLE_INT("vfs.mountroot.timeout", &root_mount_timeout); > > +static int root_mount_always_wait = 0; > +SYSCTL_INT(_vfs, OID_AUTO, root_mount_always_wait, CTLFLAG_RDTUN, > + &root_mount_always_wait, 0, > + "Wait for root mount holds even if the root device already exists"); > + > SYSCTL_PROC(_vfs, OID_AUTO, root_mount_hold, > CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, > NULL, 0, sysctl_vfs_root_mount_hold, "A", > @@ -961,10 +966,11 @@ vfs_mountroot_wait_if_neccessary(const c > > /* > * In case of ZFS and NFS we don't have a way to wait for > - * specific device. > + * specific device. Also do the wait if the user forced that > + * behaviour by setting vfs.root_mount_always_wait=1. > */ > if (strcmp(fs, "zfs") == 0 || strstr(fs, "nfs") != NULL || > - dev[0] == '\0') { > + dev[0] == '\0' || root_mount_always_wait != 0) { > vfs_mountroot_wait(); > return (0); > } > >