Re: [PATCH] erofs-utils: mkfs: also handle last compacted 2B pack in z_erofs_drop_inline_pcluster
Zhiguo Niu <[email protected]>
| Newsgroups | org.ozlabs.lists.linux-erofs |
|---|---|
| Message-ID | <CAHJ8P3KB02f2dTWrMXtyBMQwfqmFEeOwa4SW8CKL-rKrE=Dg=w@mail.gmail.com> |
Gao Xiang <[email protected]> 于2026年5月11日周一 12:01写道: > > Hi Zhiguo, > > On 2026/4/29 15:59, Zhiguo Niu wrote: > > With ztailpacking enabled, the current process assumes that a compacted_4b_end > > always exists in the compacted pack. However, in some specific files, the > > compacted pack may not have a compacted_4b_end. This leads to an incorrect > > modification of the last compacted_2B entry, resulting in incorrect modification > > of its clusterofs. In subsequent fsck operations, incorrect parameters will > > affect the decompression of the penultimate pcluster. > > > > This patch determines whether the last entry of the current compacted pack > > belongs to compacted 2B or 4B and then updates the correct bits accordingly. > > > > Fixes: a7c1f0575ef8 ("erofs-utils: lib: refine tailpcluster compression approach") > > Signed-off-by: Zhiguo Niu <[email protected]> > > Sorry for late response. > > I do think the issue is valid, but either the previous > solution or the proposed one is ugly. Hi Xiang, Yes it would be ideal if the same piece of common code could cover both scenarios. But I haven't figured it out yet, so I'll distinguish them like this for now. ^^ thanks! > > I wonder if there exists a better way to fixup the last lcluster > type into plain instead: I've thought about for a while but without > any valid suggestion. > > Thanks, > Gao Xiang