mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									88be308b2f
								
							
						
					
					
						commit
						0c4f86be74
					
				| @ -129,6 +129,7 @@ dnode_cons(void *arg, void *unused, int kmflag) | |||||||
| 	zfs_refcount_create(&dn->dn_tx_holds); | 	zfs_refcount_create(&dn->dn_tx_holds); | ||||||
| 	list_link_init(&dn->dn_link); | 	list_link_init(&dn->dn_link); | ||||||
| 
 | 
 | ||||||
|  | 	bzero(&dn->dn_next_type[0], sizeof (dn->dn_next_type)); | ||||||
| 	bzero(&dn->dn_next_nblkptr[0], sizeof (dn->dn_next_nblkptr)); | 	bzero(&dn->dn_next_nblkptr[0], sizeof (dn->dn_next_nblkptr)); | ||||||
| 	bzero(&dn->dn_next_nlevels[0], sizeof (dn->dn_next_nlevels)); | 	bzero(&dn->dn_next_nlevels[0], sizeof (dn->dn_next_nlevels)); | ||||||
| 	bzero(&dn->dn_next_indblkshift[0], sizeof (dn->dn_next_indblkshift)); | 	bzero(&dn->dn_next_indblkshift[0], sizeof (dn->dn_next_indblkshift)); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Mark Johnston
						Mark Johnston