linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 1/2] erofs: avoid memory allocation failure during rolling decompression
@ 2021-03-16  3:15 Huang Jianan via Linux-erofs
  2021-03-16  3:15 ` [PATCH v6 2/2] erofs: decompress in endio if possible Huang Jianan via Linux-erofs
  2021-03-16  7:38 ` [PATCH v6 1/2] erofs: avoid memory allocation failure during rolling decompression Chao Yu
  0 siblings, 2 replies; 5+ messages in thread
From: Huang Jianan via Linux-erofs @ 2021-03-16  3:15 UTC (permalink / raw)
  To: linux-erofs; +Cc: linux-kernel, guoweichao, zhangshiming

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.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
Signed-off-by: Guo Weichao <guoweichao@oppo.com>
Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
---
 fs/erofs/decompressor.c | 5 ++---
 1 file 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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-17  3:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16  3:15 [PATCH v6 1/2] erofs: avoid memory allocation failure during rolling decompression Huang Jianan via Linux-erofs
2021-03-16  3:15 ` [PATCH v6 2/2] erofs: decompress in endio if possible Huang Jianan via Linux-erofs
2021-03-16  8:26   ` Chao Yu
2021-03-17  3:54     ` Huang Jianan via Linux-erofs
2021-03-16  7:38 ` [PATCH v6 1/2] erofs: avoid memory allocation failure during rolling decompression Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).