mirror of
https://github.com/Zygo/bees.git
synced 2025-05-18 13:55:44 +02: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:
parent
e7fbd0c732
commit
d11906c4e8
@ -185,9 +185,12 @@ BeesRoots::transid_min()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
uint64_t rv = numeric_limits<uint64_t>::max();
|
uint64_t rv = numeric_limits<uint64_t>::max();
|
||||||
|
const uint64_t max_rv = rv;
|
||||||
for (auto i : m_root_crawl_map) {
|
for (auto i : m_root_crawl_map) {
|
||||||
rv = min(rv, i.second->get_state_end().m_min_transid);
|
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;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user