<div dir="ltr">Hi Yifan,<br><br>Thank you for the guidance and for clarifying the review workflow.<br><br>Understood. I will consolidate related fixes into proper patch <br>series with a cover letter in future submissions instead of <br>sending individual patches.<br><br>I will also follow the versioning conventions (v2/v3 for updates <br>and RESEND for unchanged resubmissions) and adopt the backport <br>commit message format described in commit ee2709, including <br>square bracket annotations where applicable.<br><br>Thanks again for the review and suggestions.<br><br>Best regards,<br>Utkal Singh</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, 16 Mar 2026 at 08:41, Yifan Zhao <<a href="mailto:yifan.yfzhao@foxmail.com">yifan.yfzhao@foxmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">Hi Utkal Singh,</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">
</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">Thank you for your contributions and the recent fixes.</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">
</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">To help us manage the review process more effectively and avoid confusion with duplicate emails,</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">could you please consolidate these random fixes into a </span><strong style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);font-weight:600"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">single patch series with a cover letter</span></strong><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)"> in the future?</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">This allows us to track the entire set of changes in one thread.</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">
</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">Additionally, please follow these conventions for follow-ups:</span></div>
    <ol start="1" dir="auto" style="margin:1rem 0px;padding:0px 0px 0px 1.625em;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><li style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);unicode-bidi:plaintext"><strong style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);font-weight:600"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">Versioning:</span></strong><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)"> If you modify a patch based on review feedback, please increment the version prefix (e.g., v2, v3) in the subject line.</span></li><li style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);unicode-bidi:plaintext"><strong style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);font-weight:600"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">Resends:</span></strong><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)"> If you are simply resending a patch without changes (e.g., to bump it), please add a </span><strong style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);font-weight:600"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">RESEND</span></strong><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)"> prefix to the subject line instead of treating it as a new version.</span></li></ol>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">This will greatly help in tracking which patches need to be merged.</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">
</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Regarding backporting patches to the kernel, please refer to commit ee2709 in the erofs-utils repository for the preferred commit message format.</div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Specifically, please use square brackets [] to describe any modifications you made to the source kernel commit during the backport process.</div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">[ Gao may follow up with additional workflow details if needed. ]</div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">
</span></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"></div>
    <div style="margin:1rem 0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227);color:rgb(29,29,31);font-family:system-ui,ui-sans-serif,-apple-system,BlinkMacSystemFont,Inter,NotoSansHans,sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-line;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="margin:0px;padding:0px;box-sizing:border-box;border-width:0px;border-style:solid;border-color:rgb(227,227,227)">Thanks again for your help.</span></div>
    <p>Yifan Zhao</p>
    <p><br>
    </p>
    <div>On 3/15/2026 10:22 PM, Utkal Singh
      wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>Encoded extents use fmt field as algorithm index without checking
available_compr_algs bitmask. The non-encoded path already has this
check but the encoded extent path in z_erofs_map_blocks_ext() was
missing equivalent validation.

Add available_compr_algs consistency check for encoded extents,
following kernel commit 131897c65e2b.

Signed-off-by: Utkal Singh <a href="mailto:singhutkal015@gmail.com" target="_blank"><singhutkal015@gmail.com></a>
---
 lib/zmap.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/zmap.c b/lib/zmap.c
index 0e7af4e..a8d1ca6 100644
--- a/lib/zmap.c
+++ b/lib/zmap.c
@@ -630,8 +630,17 @@ static int z_erofs_map_blocks_ext(struct erofs_inode *vi,
                        if (map->m_plen & Z_EROFS_EXTENT_PLEN_PARTIAL)
                                map->m_flags |= EROFS_MAP_PARTIAL_REF;
                        map->m_plen &= Z_EROFS_EXTENT_PLEN_MASK;
-                       if (fmt)
-                               map->m_algorithmformat = fmt - 1;
+                       if (fmt) {
+                               unsigned int afmt = fmt - 1;
+
+                               if (afmt >= Z_EROFS_COMPRESSION_MAX ||
+                                   !(sbi->available_compr_algs & (1 << afmt))) {
+                                       erofs_err("unknown algorithm %u for encoded extent, nid %llu",
+                                                 afmt, vi->nid | 0ULL);
+                                       return -EOPNOTSUPP;
+                               }
+                               map->m_algorithmformat = afmt;
+                       }
                        else if (interlaced && !((map->m_pa | map->m_plen) & bmask))
                                map->m_algorithmformat =
                                        Z_EROFS_COMPRESSION_INTERLACED;
</pre>
    </blockquote>
  </div>

</blockquote></div>