erofs-utils: clear compacted_2b if compacted_4b_initial > totalidx
PATCH 1/1 erofs-utils: clear compacted_2b if compacted_4b_initial > totalidx
Keep in sync with the latest kernel
commit c40dd3ca2a45 ("erofs: clear compacted_2b if compacted_4b_initial > totalidx")
Signed-off-by Gao Xiang <[email protected]>
--- lib/zmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/zmap.c +2 -1
@@ -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 ;
Signature · 1 line
2.20.1