]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Initialize dn_next_type[] in the dnode constructor
authorMark Johnston <markj@FreeBSD.org>
Fri, 16 Jul 2021 14:12:47 +0000 (10:12 -0400)
committerTony Hutter <hutter2@llnl.gov>
Tue, 14 Sep 2021 20:07:44 +0000 (13:07 -0700)
commitac573e31053ff4052fb74a0891ba6deae44f497c
tree46670ea88e278d0a8642232fdcc3d2460ee3e8ea
parent99df200ffce8a100146861295d9b1a41a5ff9104
Initialize dn_next_type[] in the dnode constructor

It seems nothing ensures that this array is zeroed when a dnode is
freshly allocated, so in principle it retains the values from the
previous allocation.  In practice it seems to be the case that the
fields should end up zeroed, but we can zero the field anyway for
consistency.

This was found using KMSAN.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #12383
module/zfs/dnode.c