Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2488202rdb; Sun, 3 Dec 2023 20:32:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFechLm9xrmaOOH4hE9Ygw5sYwAab218NGATg8nUn1bwYWfq5IJbo51y5h8RQ3TKXQ4eaZJ X-Received: by 2002:a17:906:209e:b0:a18:e9fe:2d9 with SMTP id 30-20020a170906209e00b00a18e9fe02d9mr2988229ejq.25.1701664370337; Sun, 03 Dec 2023 20:32:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701664370; cv=none; d=google.com; s=arc-20160816; b=iABOZWIfAqpYn5w6p0K2ipgdbX4j/56pj9x8GFx4mnrjhTdVXBVDGavquGb/CDmBli Q/T1mSivgFywxguJ/PtxeVJe+NNvGGFwGUoL9qwXcUllsY5NMeXUK85ZsfH+V+xT7GH7 shJfm/96K5mAxf4BBD1Q4DfKVM05vx+6Cb5qhnV930/KgvzCAQ2ltxn4cAyuaa6/Bhl9 gyLZQvqvzKHkzuAMHJtEdFDPch9jNWVCnKUQUPjx6fYL2DKttHDt66Irc9Ht3FpHByr8 Auq7vMmVRtdXQJjdatFySpNbaE0b/pym8JI04LygSQRGB14pDSNRI7+OqISY25PxZ84c 1CwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=ltfr1lZEbQgPJHr0/T7QgA7mE1cSBuRmQ3j17DfEgJo=; fh=lu/tPeEXAWkOKkhDPjjju3elchBJBHmfBru6TOqAVzw=; b=ol4lMqyBPVMKwTltjFNuoiJaoavJ8mvbUTla9W4cUWyQfsNRTZKPBchadvKbjWK3ic tVjygOrHwkcXPDAmBbtt3CXOOFiNVpyteUpWys/O4Geo2YRWDbicjSfDNShvZHk4qWDZ iUKdBN2O88a5z70n5O4PEwh9QcmqdTRPL7BDVm1I1xFda9HWrBTlVDVNj4R6wSg6UMF/ VsEivebW8EG2X+fN36QSPexG8Zizsw27FkHR9Qz+qaYo4PBZ9bhrpdhrG7Fx2BJvRk/H lB2YeHHKlC/eJE25sfYTQ4Oz1IxCxWJ5ZENLujpddEoM7Z5mYRXkrg5Sr1IEt+jyLaFb Iz9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto+bounces-522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gq12-20020a170906e24c00b00a0435edec7csi4104617ejb.692.2023.12.03.20.32.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 20:32:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto+bounces-522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1D9D01F20F9F for ; Mon, 4 Dec 2023 04:32:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6726E565 for ; Mon, 4 Dec 2023 04:32:48 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76E40B6 for ; Sun, 3 Dec 2023 19:28:07 -0800 (PST) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Vxhh90d_1701660484; Received: from 30.97.49.36(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Vxhh90d_1701660484) by smtp.aliyun-inc.com; Mon, 04 Dec 2023 11:28:05 +0800 Message-ID: <275f025d-e2f1-eaff-6af1-e909d370cee0@linux.alibaba.com> Date: Mon, 4 Dec 2023 11:28:02 +0800 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: Weird EROFS data corruption To: Juhyung Park Cc: Gao Xiang , linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net, linux-crypto@vger.kernel.org, Yann Collet References: <5a0e8b44-6feb-b489-cdea-e3be3811804a@linux.alibaba.com> <649a3bc4-58bb-1dc8-85fb-a56e47b3d5c9@linux.alibaba.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023/12/4 01:32, Juhyung Park wrote: > Hi Gao, ... >>> >>>> >>>> What is the difference between these two machines? just different CPU or >>>> they have some other difference like different compliers? >>> >>> I fully and exclusively control both devices, and the setup is almost the same. >>> Same Ubuntu version, kernel/compiler version. >>> >>> But as I said, on my laptop, the issue happens on kernels that someone >>> else (Canonical) built, so I don't think it matters. >> >> The only thing I could say is that the kernel side has optimized >> inplace decompression compared to fuse so that it will reuse the >> same buffer for decompression but with a safe margin (according to >> the current lz4 decompression implementation). It shouldn't behave >> different just due to different CPUs. Let me find more clues >> later, also maybe we should introduce a way for users to turn off >> this if needed. > > Cool :) > > I'm comfortable changing and building my own custom kernel for this > specific laptop. Feel free to ask me to try out some patches. Thanks, I need to narrow down this issue: - First, could you apply the following diff to test if it's still reproducable? diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c index 021be5feb1bc..40a306628e1a 100644 --- a/fs/erofs/decompressor.c +++ b/fs/erofs/decompressor.c @@ -131,7 +131,7 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx, if (rq->inplace_io) { omargin = PAGE_ALIGN(ctx->oend) - ctx->oend; - if (rq->partial_decoding || !may_inplace || + if (1 || rq->partial_decoding || !may_inplace || omargin < LZ4_DECOMPRESS_INPLACE_MARGIN(rq->inputsize)) goto docopy; - Could you share the full message about the output of `lscpu`? Thanks, Gao Xiang