uma: Don't allow a limit to be set in a warm zone

The limit accounting in UMA does not tolerate this.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Mark Johnston 2022-03-30 15:42:18 -04:00
parent 54361f9020
commit d53927b0ba

View file

@ -4880,6 +4880,8 @@ uma_zone_set_max(uma_zone_t zone, int nitems)
* way to clear a limit.
*/
ZONE_LOCK(zone);
if (zone->uz_max_items == 0)
ZONE_ASSERT_COLD(zone);
zone->uz_max_items = nitems;
zone->uz_flags |= UMA_ZFLAG_LIMIT;
zone_update_caches(zone);