Skip to content

Commit 0a2163d

Browse files
authored
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 <[email protected]> Reviewed-by: Rob Norris <[email protected]> Signed-off-by: Mark Johnston <[email protected]> Closes #17486
1 parent d461a67 commit 0a2163d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

module/os/freebsd/zfs/zfs_znode_os.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ zfs_create_share_dir(zfsvfs_t *zfsvfs, dmu_tx_t *tx)
293293
sharezp->z_atime_dirty = 0;
294294
sharezp->z_zfsvfs = zfsvfs;
295295
sharezp->z_is_sa = zfsvfs->z_use_sa;
296+
sharezp->z_pflags = 0;
296297

297298
VERIFY0(zfs_acl_ids_create(sharezp, IS_ROOT_NODE, &vattr,
298299
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)
17691770
rootzp->z_unlinked = 0;
17701771
rootzp->z_atime_dirty = 0;
17711772
rootzp->z_is_sa = USE_SA(version, os);
1773+
rootzp->z_pflags = 0;
17721774

17731775
zfsvfs->z_os = os;
17741776
zfsvfs->z_parent = zfsvfs;

0 commit comments

Comments
 (0)