linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] erofs: fix the per-CPU buffer decompression for small output size
@ 2021-10-13  9:29 Yue Hu
  2021-10-13 11:51 ` Gao Xiang
  0 siblings, 1 reply; 6+ messages in thread
From: Yue Hu @ 2021-10-13  9:29 UTC (permalink / raw)
  To: xiang, chao; +Cc: linux-erofs, linux-kernel, huyue2, zhangwen, zbestahu

From: Yue Hu <huyue2@yulong.com>

Note that z_erofs_lz4_decompress() will return a positive value if
decompression succeeds. However, we do not copy_from_pcpubuf() due
to !ret. Let's fix it.

Signed-off-by: Yue Hu <huyue2@yulong.com>
---
 fs/erofs/decompressor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
index a5bc4b1..e4cab4e 100644
--- a/fs/erofs/decompressor.c
+++ b/fs/erofs/decompressor.c
@@ -326,7 +326,7 @@ static int z_erofs_decompress_generic(struct z_erofs_decompress_req *rq,
 
 			rq->inplace_io = false;
 			ret = alg->decompress(rq, dst);
-			if (!ret)
+			if (ret > 0)
 				copy_from_pcpubuf(rq->out, dst, rq->pageofs_out,
 						  rq->outputsize);
 
-- 
1.9.1


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

end of thread, other threads:[~2021-10-14  1:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  9:29 [PATCH] erofs: fix the per-CPU buffer decompression for small output size Yue Hu
2021-10-13 11:51 ` Gao Xiang
2021-10-13 11:58   ` Gao Xiang
2021-10-13 13:10   ` Yue Hu
2021-10-13 16:03     ` Gao Xiang
2021-10-14  1:42       ` Yue Hu

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).