code: func (a *Allocator) checkConsistency(as string) {
  	var sKeyList []SubnetKey
  
  	// Retrieve this address space's configuration and bitmasks from the datastore
  	a.refresh(as)
  	a.Lock()
  	aSpace, ok := a.addrSpaces[as]
  	a.Unlock()
  	if !ok {
  		return
  	}
  	a.updateBitMasks(aSpace)
  
  	aSpace.Lock()
  	for sk, pd := range aSpace.subnets {
  		if pd.Range != nil {
  			continue
  		}
  		sKeyList = append(sKeyList, sk)
  	}
  	aSpace.Unlock()
  
  	for _, sk := range sKeyList {
  		a.Lock()
  		bm := a.addresses[sk]
  		a.Unlock()
  		if err := bm.CheckConsistency(); err != nil {
  			logrus.Warnf("Error while running consistency check for %s: %v", sk, err)
  		}
  	}
  }
docs: // Checks for and fixes damaged bitmask.