<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:等线;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@等线";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:等线;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:等线;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="#0563C1" vlink="#954F72" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">>Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>On 2024/8/22 14:27, liujinbao1 wrote:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> From: liujinbao1 <liujinbao1@xiaomi.com><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> When i=0 and err is not equal to 0,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> the while(-1) loop will enter into an<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> infinite loop. This patch avoids this issue.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>Missing your Signed-off-by here.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> ---<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> fs/erofs/decompressor.c | 2 ++<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> 1 file changed, 2 insertions(+)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c index
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> c2253b6a5416..1b2b8cc7911c 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> --- a/fs/erofs/decompressor.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> +++ b/fs/erofs/decompressor.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> @@ -539,6 +539,8 @@ int __init z_erofs_init_decompressor(void)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> for (i = 0; i < Z_EROFS_COMPRESSION_MAX; ++i) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> err = z_erofs_decomp[i] ? z_erofs_decomp[i]->init() : 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> if (err) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> + if (!i)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> + return err;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> while (--i)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> if (z_erofs_decomp[i])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>> z_erofs_decomp[i]->exit();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>Thanks for catching this, how about the following diff (space-demaged).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>If it looks good to you, could you please send another version?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Sure, I can do that.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c index c2253b6a5416..c9b2bc1309d2 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>--- a/fs/erofs/decompressor.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>+++ b/fs/erofs/decompressor.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>@@ -534,18 +534,16 @@ int z_erofs_parse_cfgs(struct super_block *sb, struct erofs_super_block *dsb)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> int __init z_erofs_init_decompressor(void)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>- int i, err;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>+ int i, err = 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> for (i = 0; i < Z_EROFS_COMPRESSION_MAX; ++i) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> err = z_erofs_decomp[i] ? z_erofs_decomp[i]->init() : 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>- if (err) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>+ if (err && i)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> while (--i)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> if (z_erofs_decomp[i])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> z_erofs_decomp[i]->exit();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>- return err;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>- }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>- return 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">>+ return err;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">><o:p> </o:p></span></p>
</div>
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address
is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in
error, please notify the sender by phone or email immediately and delete it!******/#
</body>
</html>