From mboxrd@z Thu Jan 1 00:00:00 1970 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 A940DC04A94 for ; Sun, 30 Jul 2023 14:01:28 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RDNMW11dNz2yGf for ; Mon, 31 Jul 2023 00:01:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.99; helo=out30-99.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (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 4RDNMN5cPYz2yDH for ; Mon, 31 Jul 2023 00:01:19 +1000 (AEST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VoVu1lI_1690725672; Received: from 192.168.75.41(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VoVu1lI_1690725672) by smtp.aliyun-inc.com; Sun, 30 Jul 2023 22:01:13 +0800 Message-ID: Date: Sun, 30 Jul 2023 22:01:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2] erofs: deprecate superblock checksum feature To: =?UTF-8?Q?Thomas_Wei=c3=9fschuh?= , Jingbo Xu References: <20230717112703.60130-1-jefflexu@linux.alibaba.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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: Karel Zak , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, huyue2@coolpad.com Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" Hi Thomas, On 2023/7/30 21:31, Thomas Weißschuh wrote: > On 2023-07-17 19:27:03+0800, Jingbo Xu wrote: >> Later we're going to try the self-contained image verification. >> The current superblock checksum feature has quite limited >> functionality, instead, merkle trees can provide better protection >> for image integrity. > > The crc32c checksum is also used by libblkid to gain more confidence > in its filesystem detection. > I guess a merkle tree would be much harder to implement. > > This is for example used by the mount(8) cli program to allow mounting > of devices without explicitly needing to specify a filesystem. > > Note: libblkid tests for EROFS_FEATURE_SB_CSUM so at least it won't > break when the checksum is removed. I'm not sure if we could switch EROFS_FEATURE_SB_CSUM to a simpler checksum instead (e.g. just sum each byte up if both EROFS_FEATURE_SB_CSUM and COMPAT_XATTR_FILTER bits are set, or ignore checksums completely at least in the kernel) if the better filesystem detection by using sb chksum is needed (not sure if other filesystems have sb chksum or just do magic comparsion)? The main problem here is after xattr name filter feature is added (xxhash is generally faster than crc32c), there could be two hard-depended hashing algorithms, this increases more dependency especially for embededed devices. Thanks, Gao Xiang