diff options
author | mav <mav@FreeBSD.org> | 2013-11-27 19:55:42 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-11-27 19:55:42 +0000 |
commit | 8773f9e310419dfb13c5aa9fad0765dfea5ab83a (patch) | |
tree | 718d0ce41cd9d93edab6209c7ac3f8d76f13262a /sys/vm | |
parent | 7183522461c297075cc1d76cd540b425a9905969 (diff) | |
download | FreeBSD-src-8773f9e310419dfb13c5aa9fad0765dfea5ab83a.zip FreeBSD-src-8773f9e310419dfb13c5aa9fad0765dfea5ab83a.tar.gz |
Fix bug introduced at r252226, when udata argument passed to bucket_alloc()
was used without making sure first that it was really passed for us.
On some of my systems this bug made user argument passed by ZFS code to
uma_zalloc_arg() unexpectedly block UMA per-CPU caches for those zones.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/uma_core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 62c2c52..dbb37c5 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -369,12 +369,13 @@ bucket_alloc(uma_zone_t zone, void *udata, int flags) * buckets via the allocation path or bucket allocations in the * free path. */ - if ((uintptr_t)udata & UMA_ZFLAG_BUCKET) - return (NULL); if ((zone->uz_flags & UMA_ZFLAG_BUCKET) == 0) udata = (void *)(uintptr_t)zone->uz_flags; - else + else { + if ((uintptr_t)udata & UMA_ZFLAG_BUCKET) + return (NULL); udata = (void *)((uintptr_t)udata | UMA_ZFLAG_BUCKET); + } if ((uintptr_t)udata & UMA_ZFLAG_CACHEONLY) flags |= M_NOVM; ubz = bucket_zone_lookup(zone->uz_count); |