From owner-svn-src-head@freebsd.org Tue Sep 5 14:32:57 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 D93C5E0C7A7; Tue, 5 Sep 2017 14:32:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 9EF3374D7A; Tue, 5 Sep 2017 14:32:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v85EWuQj099793; Tue, 5 Sep 2017 14:32:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85EWuJn099792; Tue, 5 Sep 2017 14:32:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201709051432.v85EWuJn099792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 5 Sep 2017 14:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323183 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 323183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Tue, 05 Sep 2017 14:32:58 -0000 Author: trasz Date: Tue Sep 5 14:32:56 2017 New Revision: 323183 URL: https://svnweb.freebsd.org/changeset/base/323183 Log: 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". PR: 221846 MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Tue Sep 5 13:55:14 2017 (r323182) +++ head/sys/kern/vfs_mountroot.c Tue Sep 5 14:32:56 2017 (r323183) @@ -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);