summaryrefslogtreecommitdiff
path: root/fs/erofs/decompressor.c
diff options
context:
space:
mode:
authorHuang Jianan <huangjianan@oppo.com>2021-03-16 06:15:14 +0300
committerGao Xiang <hsiangkao@redhat.com>2021-03-29 05:18:00 +0300
commitb4892fa3e7fd69e78a82356de45b90758589cafc (patch)
tree0e53b1067d0d70eab2b6545cd7248fc67d1c6202 /fs/erofs/decompressor.c
parenta5e13c6df0e41702d2b2c77c8ad41677ebb065b3 (diff)
downloadlinux-b4892fa3e7fd69e78a82356de45b90758589cafc.tar.xz
erofs: avoid memory allocation failure during rolling decompression
Currently, err would be treated as io error. Therefore, it'd be better to ensure memory allocation during rolling decompression to avoid such io error. In the long term, we might consider adding another !Uptodate case for such case. Link: https://lore.kernel.org/r/20210316031515.90954-1-huangjianan@oppo.com Reviewed-by: Gao Xiang <hsiangkao@redhat.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Huang Jianan <huangjianan@oppo.com> Signed-off-by: Guo Weichao <guoweichao@oppo.com> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Diffstat (limited to 'fs/erofs/decompressor.c')
-rw-r--r--fs/erofs/decompressor.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
index 1cb1ffd10569..34e73ff76f89 100644
--- a/fs/erofs/decompressor.c
+++ b/fs/erofs/decompressor.c
@@ -73,9 +73,8 @@ static int z_erofs_lz4_prepare_destpages(struct z_erofs_decompress_req *rq,
victim = availables[--top];
get_page(victim);
} else {
- victim = erofs_allocpage(pagepool, GFP_KERNEL);
- if (!victim)
- return -ENOMEM;
+ victim = erofs_allocpage(pagepool,
+ GFP_KERNEL | __GFP_NOFAIL);
set_page_private(victim, Z_EROFS_SHORTLIVED_PAGE);
}
rq->out[i] = victim;