[PATCH] erofs-utils: avoid unnecessary insert behavior when not deduplicating

Yue Hu zbestahu at gmail.com
Thu Oct 13 15:00:11 AEDT 2022


From: Yue Hu <huyue2 at coolpad.com>

We should do nothing in dedupe inserting when it's not configured.

Signed-off-by: Yue Hu <huyue2 at coolpad.com>
---
 lib/dedupe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dedupe.c b/lib/dedupe.c
index 7962014..9cad905 100644
--- a/lib/dedupe.c
+++ b/lib/dedupe.c
@@ -99,7 +99,7 @@ int z_erofs_dedupe_insert(struct z_erofs_inmem_extent *e,
 {
 	struct z_erofs_dedupe_item *di;
 
-	if (e->length < window_size)
+	if (!dedupe_subtree || e->length < window_size)
 		return 0;
 
 	di = malloc(sizeof(*di) + e->length - window_size);
-- 
2.17.1



More information about the Linux-erofs mailing list