Fix large order allocation in dm mq policy (rhbz 993744)

This commit is contained in:
Josh Boyer 2013-10-10 08:53:35 -04:00
parent b817316a0e
commit 2d330008c4
2 changed files with 40 additions and 0 deletions

View File

@ -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:

View File

@ -751,6 +751,9 @@ Patch25124: vfio-iommu-Fixed-interaction-of-VFIO_IOMMU_MAP_DMA.patch
Patch25126: 0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch Patch25126: 0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch
Patch25127: 0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch Patch25127: 0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch
#rhbz 993744
Patch25128: dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch
# END OF PATCH DEFINITIONS # END OF PATCH DEFINITIONS
%endif %endif
@ -1460,6 +1463,9 @@ ApplyPatch vfio-iommu-Fixed-interaction-of-VFIO_IOMMU_MAP_DMA.patch
ApplyPatch 0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch ApplyPatch 0001-iwlwifi-don-t-WARN-on-host-commands-sent-when-firmwa.patch
ApplyPatch 0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch ApplyPatch 0002-iwlwifi-don-t-WARN-on-bad-firmware-state.patch
#rhbz 993744
ApplyPatch dm-cache-policy-mq_fix-large-scale-table-allocation-bug.patch
# END OF PATCH APPLICATIONS # END OF PATCH APPLICATIONS
%endif %endif
@ -2263,6 +2269,9 @@ fi
# ||----w | # ||----w |
# || || # || ||
%changelog %changelog
* Thu Oct 10 2013 Josh Boyer <jwboyer@fedoraproject.org>
- Fix large order allocation in dm mq policy (rhbz 993744)
* Wed Oct 09 2013 Josh Boyer <jwboyer@fedoraproject.org> - 3.12.0-0.rc4.git2.1 * Wed Oct 09 2013 Josh Boyer <jwboyer@fedoraproject.org> - 3.12.0-0.rc4.git2.1
- Don't trigger a stack trace on crashing iwlwifi firmware (rhbz 896695) - Don't trigger a stack trace on crashing iwlwifi firmware (rhbz 896695)
- Linux v3.12-rc4-29-g0e7a3ed - Linux v3.12-rc4-29-g0e7a3ed