* [PATCH] erofs-utils: clear compacted_2b if compacted_4b_initial > totalidx
@ 2021-12-14 1:33 Gao Xiang
0 siblings, 0 replies; only message in thread
From: Gao Xiang @ 2021-12-14 1:33 UTC (permalink / raw)
To: linux-erofs
Keep in sync with the latest kernel
commit c40dd3ca2a45 ("erofs: clear compacted_2b if compacted_4b_initial > totalidx")
Signed-off-by: Gao Xiang <xiang@kernel.org>
---
lib/zmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/zmap.c b/lib/zmap.c
index 09d5d35e65ee..abc8babd6763 100644
--- a/lib/zmap.c
+++ b/lib/zmap.c
@@ -315,7 +315,8 @@ static int compacted_load_cluster_from_disk(struct z_erofs_maprecorder *m,
if (compacted_4b_initial == 32 / 4)
compacted_4b_initial = 0;
- if (vi->z_advise & Z_EROFS_ADVISE_COMPACTED_2B)
+ if ((vi->z_advise & Z_EROFS_ADVISE_COMPACTED_2B) &&
+ compacted_4b_initial < totalidx)
compacted_2b = rounddown(totalidx - compacted_4b_initial, 16);
else
compacted_2b = 0;
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-14 1:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-14 1:33 [PATCH] erofs-utils: clear compacted_2b if compacted_4b_initial > totalidx Gao Xiang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.