mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
Don't allocate from new metaslabs
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Paul Dagnelie <pcd@delphix.com> Closes #15307 Closes #15308
This commit is contained in:
parent
d38f4664a6
commit
9e36c5769f
@ -3208,6 +3208,15 @@ metaslab_segment_weight(metaslab_t *msp)
|
|||||||
static boolean_t
|
static boolean_t
|
||||||
metaslab_should_allocate(metaslab_t *msp, uint64_t asize, boolean_t try_hard)
|
metaslab_should_allocate(metaslab_t *msp, uint64_t asize, boolean_t try_hard)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* This case will usually but not always get caught by the checks below;
|
||||||
|
* metaslabs can be loaded by various means, including the trim and
|
||||||
|
* initialize code. Once that happens, without this check they are
|
||||||
|
* allocatable even before they finish their first txg sync.
|
||||||
|
*/
|
||||||
|
if (unlikely(msp->ms_new))
|
||||||
|
return (B_FALSE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the metaslab is loaded, ms_max_size is definitive and we can use
|
* If the metaslab is loaded, ms_max_size is definitive and we can use
|
||||||
* the fast check. If it's not, the ms_max_size is a lower bound (once
|
* the fast check. If it's not, the ms_max_size is a lower bound (once
|
||||||
|
Loading…
Reference in New Issue
Block a user