Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Mar 2017 10:35:57 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r315540 - stable/11/sys/kern
Message-ID:  <201703191035.v2JAZvNv068929@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sun Mar 19 10:35:56 2017
New Revision: 315540
URL: https://svnweb.freebsd.org/changeset/base/315540

Log:
  MFC r313351:
  
  Make root_mount_hold() work after boot. This is important for two
  reasons. First is rerooting into USB-mounted device that happens
  to be not yet enumerated. The second is when mounting with (non-root)
  filesystem on USB device on a hub that's enumerated later than the root
  mount: the rc scripts explicitly mount for the root mount holds to be
  released, but each USB bus takes the hold asynchronously, and if that
  happens after root mount, it would just get ignored.

Modified:
  stable/11/sys/kern/vfs_mountroot.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_mountroot.c
==============================================================================
--- stable/11/sys/kern/vfs_mountroot.c	Sun Mar 19 10:34:26 2017	(r315539)
+++ stable/11/sys/kern/vfs_mountroot.c	Sun Mar 19 10:35:56 2017	(r315540)
@@ -171,9 +171,6 @@ root_mount_hold(const char *identifier)
 {
 	struct root_hold_token *h;
 
-	if (root_mounted())
-		return (NULL);
-
 	h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK);
 	h->who = identifier;
 	mtx_lock(&root_holds_mtx);
@@ -186,8 +183,8 @@ void
 root_mount_rel(struct root_hold_token *h)
 {
 
-	if (h == NULL)
-		return;
+	KASSERT(h != NULL, ("%s: NULL token", __func__));
+
 	mtx_lock(&root_holds_mtx);
 	LIST_REMOVE(h, list);
 	wakeup(&root_holds);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703191035.v2JAZvNv068929>