mirror of
				https://github.com/Zygo/bees.git
				synced 2025-11-04 04:00:36 +01:00 
			
		
		
		
	roots: do not allow transid_min to be numeric_limits<uint64_t>::max()
On a few test machines max_transid on subvols is getting set to 18446744073709551615 (aka uint64_t max). Prevent transid_min() from ever returning this value. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
		@@ -185,9 +185,12 @@ BeesRoots::transid_min()
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
	uint64_t rv = numeric_limits<uint64_t>::max();
 | 
			
		||||
	const uint64_t max_rv = rv;
 | 
			
		||||
	for (auto i : m_root_crawl_map) {
 | 
			
		||||
		rv = min(rv, i.second->get_state_end().m_min_transid);
 | 
			
		||||
	}
 | 
			
		||||
	// If we get through this loop without setting rv, we'll create broken crawlers due to integer overflow.
 | 
			
		||||
	THROW_CHECK2(runtime_error, rv, max_rv, max_rv > rv);
 | 
			
		||||
	return rv;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user