summaryrefslogtreecommitdiffstats
path: root/dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@fedoraproject.org>2013-10-10 08:53:35 -0400
committerJosh Boyer <jwboyer@fedoraproject.org>2013-10-10 08:53:35 -0400
commit2d330008c49a43d877016001f8f3587c4813b106 (patch)
tree5b6d5e944cdd066214ef1484f0be82d7a33b8dd4 /dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch
parentb817316a0e458997d10a704d5463a710338de111 (diff)
downloadkernel-2d330008c49a43d877016001f8f3587c4813b106.tar.gz
kernel-2d330008c49a43d877016001f8f3587c4813b106.tar.xz
kernel-2d330008c49a43d877016001f8f3587c4813b106.zip
Fix large order allocation in dm mq policy (rhbz 993744)
Diffstat (limited to 'dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch')
-rw-r--r--dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch b/dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch
new file mode 100644
index 000000000..71234c1a7
--- /dev/null
+++ b/dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch
@@ -0,0 +1,31 @@
+diff --git a/drivers/md/dm-cache-policy-mq.c b/drivers/md/dm-cache-policy-mq.c
+index cab6dd2..ec79c8f 100644
+--- a/drivers/md/dm-cache-policy-mq.c
++++ b/drivers/md/dm-cache-policy-mq.c
+@@ -868,7 +868,7 @@ static void mq_destroy(struct dm_cache_policy *p)
+ struct mq_policy *mq = to_mq_policy(p);
+
+ free_bitset(mq->allocation_bitset);
+- kfree(mq->table);
++ vfree(mq->table);
+ free_entries(mq);
+ kfree(mq);
+ }
+@@ -1189,7 +1189,7 @@ static struct dm_cache_policy *mq_create(dm_cblock_t cache_size,
+
+ mq->nr_buckets = next_power(from_cblock(cache_size) / 2, 16);
+ mq->hash_bits = ffs(mq->nr_buckets) - 1;
+- mq->table = kzalloc(sizeof(*mq->table) * mq->nr_buckets, GFP_KERNEL);
++ mq->table = vzalloc(sizeof(*mq->table) * mq->nr_buckets);
+ if (!mq->table)
+ goto bad_alloc_table;
+
+@@ -1200,7 +1200,7 @@ static struct dm_cache_policy *mq_create(dm_cblock_t cache_size,
+ return &mq->policy;
+
+ bad_alloc_bitset:
+- kfree(mq->table);
++ vfree(mq->table);
+ bad_alloc_table:
+ free_entries(mq);
+ bad_cache_alloc: