From: Yue Hu <zbestahu@gmail.com>
To: xiang@kernel.org, chao@kernel.org
Cc: huyue2@yulong.com, linux-erofs@lists.ozlabs.org,
linux-kernel@vger.kernel.org, zhangwen@yulong.com,
zbestahu@163.com
Subject: [PATCH] erofs: fix the per-CPU buffer decompression for small output size
Date: Wed, 13 Oct 2021 17:29:05 +0800 [thread overview]
Message-ID: <20211013092906.1434-1-zbestahu@gmail.com> (raw)
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
next reply other threads:[~2021-10-13 9:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 9:29 Yue Hu [this message]
2021-10-13 11:51 ` [PATCH] erofs: fix the per-CPU buffer decompression for small output size 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211013092906.1434-1-zbestahu@gmail.com \
--to=zbestahu@gmail.com \
--cc=chao@kernel.org \
--cc=huyue2@yulong.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiang@kernel.org \
--cc=zbestahu@163.com \
--cc=zhangwen@yulong.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).