From 0a2163d194e323768014e86a5952e2c23babe919 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 25 Jun 2025 12:07:17 -0400 Subject: [PATCH] FreeBSD: Ensure that z_pflags is initialized for new znodes The field is subsequently accessed in zfs_mknode(), in zfs_inherit_projid(). The Linux implementation of zfs_create_fs() has this initialization already; there is no counterpart to zfs_create_share_dir() that I can see. Reported-by: KMSAN Reviewed-by: Alexander Motin Reviewed-by: Rob Norris Signed-off-by: Mark Johnston Closes #17486 --- module/os/freebsd/zfs/zfs_znode_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/os/freebsd/zfs/zfs_znode_os.c b/module/os/freebsd/zfs/zfs_znode_os.c index a720f53b0..9bad1e13d 100644 --- a/module/os/freebsd/zfs/zfs_znode_os.c +++ b/module/os/freebsd/zfs/zfs_znode_os.c @@ -293,6 +293,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx) sharezp->z_atime_dirty = 0; sharezp->z_zfsvfs = zfsvfs; sharezp->z_is_sa = zfsvfs->z_use_sa; + sharezp->z_pflags = 0; VERIFY0(zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr, kcred, NULL, &acl_ids, NULL)); @@ -1769,6 +1770,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx) rootzp->z_unlinked = 0; rootzp->z_atime_dirty = 0; rootzp->z_is_sa = USE_SA(version, os); + rootzp->z_pflags = 0; zfsvfs->z_os = os; zfsvfs->z_parent = zfsvfs;