Commit 117a91e0f25fd7698e20ac3dfa62086be3dc82a3
1 parent
44cff8a9ee
Exists in
master
and in
7 other branches
Squashfs: Use vmalloc rather than kmalloc for zlib workspace
Bugzilla bug 31422 reports occasional "page allocation failure. order:4" at Squashfs mount time. Fix this by making zlib workspace allocation use vmalloc rather than kmalloc. Reported-by: Mehmet Giritli <mehmet@giritli.eu> Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
fs/squashfs/zlib_wrapper.c
... | ... | @@ -26,6 +26,7 @@ |
26 | 26 | #include <linux/buffer_head.h> |
27 | 27 | #include <linux/slab.h> |
28 | 28 | #include <linux/zlib.h> |
29 | +#include <linux/vmalloc.h> | |
29 | 30 | |
30 | 31 | #include "squashfs_fs.h" |
31 | 32 | #include "squashfs_fs_sb.h" |
... | ... | @@ -37,8 +38,7 @@ |
37 | 38 | z_stream *stream = kmalloc(sizeof(z_stream), GFP_KERNEL); |
38 | 39 | if (stream == NULL) |
39 | 40 | goto failed; |
40 | - stream->workspace = kmalloc(zlib_inflate_workspacesize(), | |
41 | - GFP_KERNEL); | |
41 | + stream->workspace = vmalloc(zlib_inflate_workspacesize()); | |
42 | 42 | if (stream->workspace == NULL) |
43 | 43 | goto failed; |
44 | 44 | |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | z_stream *stream = strm; |
57 | 57 | |
58 | 58 | if (stream) |
59 | - kfree(stream->workspace); | |
59 | + vfree(stream->workspace); | |
60 | 60 | kfree(stream); |
61 | 61 | } |
62 | 62 |