From nobody Sun Apr 12 13:44:14 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ftsG65tZWz6ZM3V for ; Sun, 12 Apr 2026 13:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ftsG61jmsz3kbk for ; Sun, 12 Apr 2026 13:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776001454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fT8Cj21+H2nwTjeN6Pu8twaakp4JvqDRVet0THlPb3U=; b=G0wR1qP4WwdNsZwspymXe3hAMhl2Tb+9Rs8x4sVUxonGnHloSQ3pHKh9KmjPfhNGR/PMKz PLkn4Z5A0ViK1vaJuuBwHr+MmIGjo9LxD8Z8bdieurL7+KmM+DNgRA5+k+qhD3DNdk52uH YCLjyZ1n2YJ+UGcYsIky7kBOI5dWKiD4sinRW9smZCSWQIRy3kFajqnbMo9EoUlPV2nEY5 9cBhh2w4yEN9lw/v+V5jkmYXs0j2EIJSdMhokc8+lf/KKnFrZJaQdKPHJQ1osnntlWmczz bKO1ORYiDjdGusAqxZpY/MouYhTZV97jjbgBpNVQy46zu0NnfJraTX7eqFWPPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776001454; a=rsa-sha256; cv=none; b=IZ4vTXNpEfchEgx7yhGVIEOkswtNMIH+Dwc4wG6Iifh//a/EDWY6Vo8KVkYJKfDvwAAX74 smELsObNGe+Evg3DJviLswZU7fnnOoIogf5eL/rEC6uD5jxXQWtfv6WBRnUGwoAAYMmfQK NBXt5tqQrh5s6ck710/hVKwEXowHWRNsC0MOUYRpg/zWZhOe2DIBZEYXefO0zkf5K8uaZD o2+4jkU2Y9DF9wtHmaGGo5GzSKGjKxkohLKsadkiTEkEhYYy0/uE67M1+XBrdqxLGgYzX5 tVF2jzaXxrdrvBiXExP/pm0KURm3GiNkq65WYEujUWDIpAbxd6c0hO/yf7SICw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776001454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fT8Cj21+H2nwTjeN6Pu8twaakp4JvqDRVet0THlPb3U=; b=v63I3myBImOOXzqXBq1/Sc6oZwGksf4NhGH9p7/QXaFspiS6xoS/vbLYA7ICL5DayiUcwp W7R3IzgPKHXNTXVib3/9aISsiDxxT3VIwEb7ZhhCGI1+Qz8/6SxYckztDAIGOwikpMZUg+ Ai8qIV/7Ypl/IuRAHkXUOoujh8PSryTRRok91Z9nWgKxJws4/8YqsWAEntB150sYgI105q aC09dLKGWaa45Wf8ZIlNQWnc6/irBGlRAUveUZK5zHgBaMjiW2tvp0Sl210pk7cd/UGc7A u00vtbrkYy3YGNJkNP6lIMevPTNfjxW3etQOybpaC3MqlxBv4SdoI7ECn1N6FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ftsG61Chkz4Nb for ; Sun, 12 Apr 2026 13:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42f53 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 12 Apr 2026 13:44:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 675ea9d1d6a5 - stable/14 - vfs: handle vfs_init() failures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 675ea9d1d6a5ca8d224f5fdb2d01ef3fee8e6325 Auto-Submitted: auto-generated Date: Sun, 12 Apr 2026 13:44:14 +0000 Message-Id: <69dba1ae.42f53.3afd904e@gitrepo.freebsd.org> The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=675ea9d1d6a5ca8d224f5fdb2d01ef3fee8e6325 commit 675ea9d1d6a5ca8d224f5fdb2d01ef3fee8e6325 Author: Kyle Evans AuthorDate: 2025-09-04 02:08:51 +0000 Commit: Kyle Evans CommitDate: 2026-04-12 13:43:39 +0000 vfs: handle vfs_init() failures Most vfs_init implementations will not fail, with the notable current exception that tmpfs_subr_init() can fail to allocate a new swap pager type, in which case we probably do not want to proceed and keep it registered. linsysfs was a potential consumer, but we opted to go a different direction and move pseudofs init/deinit over to first mount and last mount instead. Reviewed by: fuz, kib (cherry picked from commit 6d33507ff9b877f52516df00b012715b55d4e14f) --- sys/kern/vfs_init.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index e516d929d9d0..880a8780c367 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -404,7 +404,7 @@ vfs_register(struct vfsconf *vfc) static int once; struct vfsconf *tvfc; uint32_t hashval; - int secondpass; + int error, prevmaxconf, secondpass; if (!once) { vattr_null(&va_null); @@ -422,6 +422,7 @@ vfs_register(struct vfsconf *vfc) return (EEXIST); } + prevmaxconf = maxvfsconf; if (vfs_typenumhash != 0) { /* * Calculate a hash on vfc_name to use for vfc_typenum. Unless @@ -514,16 +515,24 @@ vfs_register(struct vfsconf *vfc) vfc->vfc_vfsops = &vfsops_sigdefer; } - if (vfc->vfc_flags & VFCF_JAIL) - prison_add_vfs(vfc); - /* * Call init function for this VFS... */ if ((vfc->vfc_flags & VFCF_SBDRY) != 0) - vfc->vfc_vfsops_sd->vfs_init(vfc); + error = vfc->vfc_vfsops_sd->vfs_init(vfc); else - vfc->vfc_vfsops->vfs_init(vfc); + error = vfc->vfc_vfsops->vfs_init(vfc); + + if (error != 0) { + maxvfsconf = prevmaxconf; + TAILQ_REMOVE(&vfsconf, vfc, vfc_list); + vfsconf_unlock(); + return (error); + } + + if ((vfc->vfc_flags & VFCF_JAIL) != 0) + prison_add_vfs(vfc); + vfsconf_unlock(); /*