summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-03-29 03:22:00 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2016-10-07 12:35:56 -0800
commit6d33b9ee7852c21d6b77712ab73ad2fe8562c08c (patch)
treee56186c046956783b99bf4823540bfe178b5da9d
parent73aa15f7adf7b7cf613a2b07e8f4909ce7e03e87 (diff)
bcache: fall back to vmalloc() in bio_uncompress_lz4()
-rw-r--r--drivers/md/bcache/io.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c
index 31555fd92c19..dae22aa966d1 100644
--- a/drivers/md/bcache/io.c
+++ b/drivers/md/bcache/io.c
@@ -1421,9 +1421,12 @@ static int bio_uncompress_lz4(struct cache_set *c,
if (!src_data)
goto err;
- dst_data = kmalloc(uncompressed_size, GFP_NOIO);
- if (!dst_data)
- goto err;
+ dst_data = kmalloc(uncompressed_size, GFP_NOIO|__GFP_NOWARN);
+ if (!dst_data) {
+ dst_data = vmalloc(uncompressed_size);
+ if (!dst_data)
+ goto err;
+ }
ret = lz4_decompress(src_data, &src_len,
dst_data, dst_len);
@@ -1433,7 +1436,7 @@ static int bio_uncompress_lz4(struct cache_set *c,
memcpy_to_bio(dst, dst_iter, dst_data + skip);
err:
- kfree(dst_data);
+ kvfree(dst_data);
bio_unmap_or_unbounce(src_data, src_bounced);
return ret;
}