mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	BRT: Check bv_mos_entries in brt_entry_lookup()
When vdev first sees some block cloning, there is a window when brt_maybe_exists() might already return true since something was cloned, but bv_mos_entries is still 0 since BRT ZAP was not yet created. In such case we should not try to look into the ZAP and dereference NULL bv_mos_entries_dnode. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rob Norris <robn@despairlabs.com> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #16851
This commit is contained in:
		
							parent
							
								
									e0039c7057
								
							
						
					
					
						commit
						19a04e5ad2
					
				@ -859,6 +859,9 @@ brt_entry_lookup(brt_vdev_t *brtvd, brt_entry_t *bre)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	uint64_t off = BRE_OFFSET(bre);
 | 
						uint64_t off = BRE_OFFSET(bre);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (brtvd->bv_mos_entries == 0)
 | 
				
			||||||
 | 
							return (SET_ERROR(ENOENT));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return (zap_lookup_uint64_by_dnode(brtvd->bv_mos_entries_dnode,
 | 
						return (zap_lookup_uint64_by_dnode(brtvd->bv_mos_entries_dnode,
 | 
				
			||||||
	    &off, BRT_KEY_WORDS, 1, sizeof (bre->bre_count), &bre->bre_count));
 | 
						    &off, BRT_KEY_WORDS, 1, sizeof (bre->bre_count), &bre->bre_count));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user