Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD2E6E7718B for ; Thu, 2 Jan 2025 02:42:45 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4YNrbR6Xzwz30DV for ; Thu, 2 Jan 2025 13:42:43 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=115.124.30.132 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1735785761; cv=none; b=b/AtDoIkRn/GZPvLECwCcKWi7Y5jK80959rC1aXtqZBMdcrwgKDGyUCMVi3VhfaXDILo21fhzTXGMF9butGyQwQQwQ/tOeSZldnVYDeHp0GdH2pq/ocGZx0k7O5gmd4MohiJ9gRb9MKYZzCVkWfFojsL1iDYQvqI8TIJV2mL/oRu/ytp3h2Wlu2OjeDr1zpps0dboXVxcNNy0Hrp4ke+wdRNRm+aH0QLAUrdkVCyn+KxDDGyTAFZDBBgIn9ROG5tgL9klQwpJQSUitUM9u7kPq3K+AOyzoZgG1rmu+NRCGv079aW7lUpnbXESsk1PUlZXI6IHy1GVLHwI4stgTPhXA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1735785761; c=relaxed/relaxed; bh=xZA/ayt4zIAaaI57f7Yuq0dsDLz6SdXdmJNoxeMf580=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MUwfTyykQOH5c1Me0KHaiBYridGjk8iAoO9sBF18Lm1v6OSznwGk1e5mzIRhnkbH+/5OhkBLIVpEn9eP97EsgOQl6s3nINQUYFVP6Zn8o6vwiQ2pQm23gUu5G0fgqNJJF+Ki04/snJgNIptu7CwZGB+ljiG+2hxKav+18N0qDs5PwjvfdUtI2jbRjnNhvGG62pgQPGyj+YVO/yCHH4N4Msy2yTKS/b/Ww8Ai9nUl3PYsRj6X6/JrC+2VL+IwJQbtvMvQVV2SQ/k1Cqo4J0S8hbT7hrpBfCQniOd48QhzZfBe/wxzxGH4+jrWQGulF1cpito4/w8PiH++SUydjm8qbg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=ic5fJpPh; dkim-atps=neutral; spf=pass (client-ip=115.124.30.132; helo=out30-132.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=ic5fJpPh; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.132; helo=out30-132.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4YNrbM2qbGz2xYr for ; Thu, 2 Jan 2025 13:42:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1735785751; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=xZA/ayt4zIAaaI57f7Yuq0dsDLz6SdXdmJNoxeMf580=; b=ic5fJpPhr8wL7pPhRIWd/FnpGwdkph7bWE6Kb3KbV7GHg7tJE9nPLJlPKozDztJeI97kmaQ6ZuM8pT7qCF5MzZqcxvkKXdPvGpzX2PqKbWP231WE6ECNow8/x0zs4vphqQMJi/144PFxC3A6G1HLQchjg8OL6Of8nQiY37B2oZA= Received: from x31i01179.sqa.na131.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WMi6QJj_1735785746 cluster:ay36) by smtp.aliyun-inc.com; Thu, 02 Jan 2025 10:42:30 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org Subject: [PATCH] erofs-utils: mkfs: fix `-Eall-fragments` for multi-threaded compression Date: Thu, 2 Jan 2025 10:42:25 +0800 Message-ID: <20250102024225.2433419-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.43.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gao Xiang Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" may_packing in __z_erofs_compress_one() is still bypassed when multi-threaded compression is enabled, which is unexpected. Furthermore, multi-threaded -Eall-fragments,ztailpacking can sometimes corrupt images. Let's fix it. Fixes: 882ad1c3157f ("erofs-utils: mkfs: fix `-Eall-fragments` for multi-threaded compression") Fixes: 10c1590c0920 ("erofs-utils: enable multi-threaded support for `-Eall-fragments`") Signed-off-by: Gao Xiang --- lib/compress.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/compress.c b/lib/compress.c index 6ac9c75..fd4c241 100644 --- a/lib/compress.c +++ b/lib/compress.c @@ -565,8 +565,7 @@ static int __z_erofs_compress_one(struct z_erofs_compress_sctx *ctx, unsigned int len = ctx->tail - ctx->head; bool is_packed_inode = erofs_is_packed_inode(inode); bool tsg = (ctx->seg_idx + 1 >= ictx->seg_num), final = !ctx->remaining; - bool may_packing = (cfg.c_fragments && tsg && final && - !is_packed_inode && !z_erofs_mt_enabled); + bool may_packing = (cfg.c_fragments && tsg && final && !is_packed_inode); bool may_inline = (cfg.c_ztailpacking && tsg && final && !may_packing); unsigned int compressedsize; int ret; -- 2.43.5