svn commit: r324268 - stable/11/sys/kern

Edward Tomasz Napierala trasz at FreeBSD.org
Wed Oct 4 11:58:54 UTC 2017


Author: trasz
Date: Wed Oct  4 11:58:52 2017
New Revision: 324268
URL: https://svnweb.freebsd.org/changeset/base/324268

Log:
  MFC r323183:
  
  Make root_mount_rel(9) ignore NULL arguments, like it used to before r313351.
  It would be better to fix API consumers to not pass NULL there - most of them,
  such as gmirror, already contain the neccessary checks - but this is easier
  and much less error-prone.
  
  One known user-visible result is that it fixes panic on a failed "graid label".

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	Wed Oct  4 11:55:34 2017	(r324267)
+++ stable/11/sys/kern/vfs_mountroot.c	Wed Oct  4 11:58:52 2017	(r324268)
@@ -183,7 +183,8 @@ void
 root_mount_rel(struct root_hold_token *h)
 {
 
-	KASSERT(h != NULL, ("%s: NULL token", __func__));
+	if (h == NULL)
+		return;
 
 	mtx_lock(&root_holds_mtx);
 	LIST_REMOVE(h, list);


More information about the svn-src-all mailing list