new_max stuff should work properly because variable 'size' and variable 'new_size' are both updated. The next few lines re-calculate the client ranges, set new_max to true if client rangs change.

the code that set update_max to true is Locker::_do_cap_update(). it allocates a C_MDL_CheckMaxSize.