From nobody Tue Feb 21 22:43:36 2023 X-Original-To: dev-commits-src-main@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 4PLvTN4PJvz3tZWD; Tue, 21 Feb 2023 22:43:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLvTN3vswz4NSW; Tue, 21 Feb 2023 22:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019416; 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=I5AqokptW+J+p3oyD0VgjyCHbmkUzU+DFOXGYOm7eC4=; b=adV9UTitfvJfZBZaT+sk2aw6khckr11Leg9mA4eVHn/EuEfZGwfzWVtCYQTz2mh0czaWVU waZcb73IN/TR5Kwd9kKbyyv7ljUHsRvshLpfnqTZRQSzUUKgxuSsYUeQTlRkRySuoVNgoW fJg2/vJKKqqo6I1mwhzuzap8C4iC1nbkNWdhxfyaafEdu+TnyyNbDotMLoi52vsJNvA8yw jgCrwaRPDJNUTbT5lfABN7VGRh/0P3WQhXHIFY/dXk89dPrhgZFCPZMrlAZOV/HfMcDFAB b9myLC5LVFKBCq1oR9z6ah/WUuH9BO/+M5k7saRvWDbRizBiVXu/aKGy8jgNXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019416; 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=I5AqokptW+J+p3oyD0VgjyCHbmkUzU+DFOXGYOm7eC4=; b=SiggXEcMYqlEr6am/kx3L4CnoesQwVumhWxR8kRU5ekrYu3iFNrgWeJHKlrc+L/tT6TmYz eBGyCSgDogFYBvRKcIPkto1Hr79M/deTiw8CovVC97zXADlJnjbeNxEjrcfZdcUxUbumyZ HptNhxtnBKzbWuxLByiJH3YL0rt6j4YEECYUagH0dqixb/lUqouMm5TkD9LMBq4PBtW/n9 pucjF1xjDZq6eeVFH8iYHgXIboJA2iSZ5G5/M2LzwS3r5KV4PqN3IDe1Ep+BvhqPXp3T/M rFgxWPo43vn/ImWS+1c4zDiJ5tkXE4ISYLcN+KM7cIxqR//V745c7l8fZXKo9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677019416; a=rsa-sha256; cv=none; b=VFGSTj1UbiIF6vLXMGlxRMMx+5OZ9mwgtI2cSgi1LepVe7o/aTckJk8EGBh6IVt14zfLha Rup1DMnflyfWanXqL5YfQvSr6r1/JlspVzsv/WnCvpsmkkukblTYi8EQ+IgG1r1caynzvV qAI5N7LnUlBsXSjMRk7DmMpZ29+Ef/ZL5qesbcdbHSkK4OiXOimsRc4hMk2nzNX7R4FfO4 vbjahYxZpO0XEJHmOC3dfoztAd4/XqN46Z1mxBnr6lMYz9kObg3P/Un1O2i9XQ5EA8HyYt hXF9NpVUkelWolmzB3xzxc4H7Bg3PSE8DQ3iMW1luDcNHjTz3kP7ajQx/NdLpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLvTN2zT0zdTq; Tue, 21 Feb 2023 22:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31LMha2l067215; Tue, 21 Feb 2023 22:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LMhavc067214; Tue, 21 Feb 2023 22:43:36 GMT (envelope-from git) Date: Tue, 21 Feb 2023 22:43:36 GMT Message-Id: <202302212243.31LMhavc067214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: 8b04c1cbfc1c - main - Fix per-jail zfs.mount_snapshot setting List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb commit 8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb Author: Allan Jude AuthorDate: 2023-02-18 01:44:34 +0000 Commit: Allan Jude CommitDate: 2023-02-21 22:42:28 +0000 Fix per-jail zfs.mount_snapshot setting When jail.conf set the nopersist flag during startup, it was incorrectly destroying the per-jail ZFS settings. PR: 260160 Reported by: imp (previous version), mm (upstream), freqlabs (upstream) MFC after: immediately Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38662 --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index a1e0595bda34..9fb2873132bf 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -2495,7 +2495,9 @@ zfs_jailparam_set(void *obj, void *data) mount_snapshot = -1; else jsys = JAIL_SYS_NEW; - if (jsys == JAIL_SYS_NEW) { + switch (jsys) { + case JAIL_SYS_NEW: + { /* "zfs=new" or "zfs.*": the prison gets its own ZFS info. */ struct zfs_jailparam *zjp; @@ -2513,12 +2515,22 @@ zfs_jailparam_set(void *obj, void *data) if (mount_snapshot != -1) zjp->mount_snapshot = mount_snapshot; mtx_unlock(&pr->pr_mtx); - } else { + break; + } + case JAIL_SYS_INHERIT: /* "zfs=inherit": inherit the parent's ZFS info. */ mtx_lock(&pr->pr_mtx); osd_jail_del(pr, zfs_jailparam_slot); mtx_unlock(&pr->pr_mtx); + break; + case -1: + /* + * If the setting being changed is not ZFS related + * then do nothing. + */ + break; } + return (0); }