summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-01-04 19:51:57 +0000
committerglebius <glebius@FreeBSD.org>2014-01-04 19:51:57 +0000
commita19f1f19020f39eaabd47f50d92dc44101a46297 (patch)
tree5462a9ad54acab9436ae7cd825b0721208eadd48 /sys/vm
parentd612a2323c2553b2747ba44baee963a08a26fa4d (diff)
downloadFreeBSD-src-a19f1f19020f39eaabd47f50d92dc44101a46297.zip
FreeBSD-src-a19f1f19020f39eaabd47f50d92dc44101a46297.tar.gz
Merge r258690 by mav from head:
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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 7c3a287..85c96e5 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -366,12 +366,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);
OpenPOWER on IntegriCloud