提交 b4892fa3 编写于 作者: H Huang Jianan 提交者: Gao Xiang

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.comReviewed-by: NGao Xiang <hsiangkao@redhat.com>
Reviewed-by: NChao Yu <yuchao0@huawei.com>
Signed-off-by: NHuang Jianan <huangjianan@oppo.com>
Signed-off-by: NGuo Weichao <guoweichao@oppo.com>
Signed-off-by: NGao Xiang <hsiangkao@redhat.com>
上级 a5e13c6d
...@@ -73,9 +73,8 @@ static int z_erofs_lz4_prepare_destpages(struct z_erofs_decompress_req *rq, ...@@ -73,9 +73,8 @@ static int z_erofs_lz4_prepare_destpages(struct z_erofs_decompress_req *rq,
victim = availables[--top]; victim = availables[--top];
get_page(victim); get_page(victim);
} else { } else {
victim = erofs_allocpage(pagepool, GFP_KERNEL); victim = erofs_allocpage(pagepool,
if (!victim) GFP_KERNEL | __GFP_NOFAIL);
return -ENOMEM;
set_page_private(victim, Z_EROFS_SHORTLIVED_PAGE); set_page_private(victim, Z_EROFS_SHORTLIVED_PAGE);
} }
rq->out[i] = victim; rq->out[i] = victim;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册