summaryrefslogtreecommitdiff
path: root/drivers/md/dm-bufio.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2018-05-17 17:29:19 +0300
committerWolfram Sang <wsa@the-dreams.de>2018-05-17 17:29:19 +0300
commit3d8b7a4ea310f3621a19d50cbe6cbc89bb23b82f (patch)
tree51a261418928d8499ecade36f74e74fc92396503 /drivers/md/dm-bufio.c
parentc599eb4ff6e0f9c525695faab7149d8d48743b1c (diff)
parentcaaccda136ae3fa1c5f6563aae22ca3c199f563a (diff)
downloadlinux-3d8b7a4ea310f3621a19d50cbe6cbc89bb23b82f.tar.xz
Merge branch 'i2c/platform_data-immutable' into i2c/for-4.18
Diffstat (limited to 'drivers/md/dm-bufio.c')
-rw-r--r--drivers/md/dm-bufio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 12aa9ca21d8c..dc385b70e4c3 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1681,8 +1681,9 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign
if (block_size <= KMALLOC_MAX_SIZE &&
(block_size < PAGE_SIZE || !is_power_of_2(block_size))) {
- snprintf(slab_name, sizeof slab_name, "dm_bufio_cache-%u", c->block_size);
- c->slab_cache = kmem_cache_create(slab_name, c->block_size, ARCH_KMALLOC_MINALIGN,
+ unsigned align = min(1U << __ffs(block_size), (unsigned)PAGE_SIZE);
+ snprintf(slab_name, sizeof slab_name, "dm_bufio_cache-%u", block_size);
+ c->slab_cache = kmem_cache_create(slab_name, block_size, align,
SLAB_RECLAIM_ACCOUNT, NULL);
if (!c->slab_cache) {
r = -ENOMEM;