Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp2425753rwb; Fri, 5 Aug 2022 21:41:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR7wqeIEvpwfmQb0x8x2hCDyKL2+4RgksL6aUxG92C1EpPuVI+8f4+plO9HR9SjJd9qSe0B0 X-Received: by 2002:a17:907:75d8:b0:730:8bf1:9a1 with SMTP id jl24-20020a17090775d800b007308bf109a1mr7217615ejc.604.1659760863510; Fri, 05 Aug 2022 21:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659760863; cv=none; d=google.com; s=arc-20160816; b=j3sKl/e/Pu3A6gcGNEwBqr0W5gqnPjocDxdnAvBZ+4zAhb9T3XMZb0W4WP6jixleYM PnqrjdbjPUT9lbfomXsiHald2wwtLHrcT52Hd9iOrWTVFBrDueu75WnBX4pwbQYQUqPv rS4qW47j+ngIrB8x+kmkqN3eqvoPgznQv6x35Rxa6YcGD8ehlBnjLtf4eHQKD9qVdjtK 4em0xhku7abr76hGwS2PgwSZzBgGlC4cWZAFYSqG9QyrxV7YxBmV2M9h5UxoN6Vi+RAu 9mVhCCzz6g+ocLekcaqF86EhU7NEa/T/+ouKL9bip0ZZjY3KrgVxHOja2rsuLLzzM6Hf Ya0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=cDC3BVAzQG54pq9UmaSIn4mDbiwGgxhWJY0f8nOksHU=; b=ikOMFsLCyPTbUUl+SOaXZh1gQmOeEdm9oWX59UJlZlnGrP4HMcQg+6W7nOEjLMkHgQ i+NGoI3sufF1vMVQAa3oPyZWcPMNj8h1IlkuyhPIjqAIcx4n2suIg/Kjb7Ffi75Fn411 zzSkpvRmJb1Mfh0b9LbLsysDBdCyQs8Qsjvi0lqlhNzaHTupgPK+xJKoHOS2EhZvQZ56 spLG0M1pRshaDLqIBh+PYmJRwVaLn3FtrtXTxma+jRyHErArj4OBpy9mRdAfH6PK6uml 4GjNeLhiAzK/RF9CneDNfCiJYaM0GTfs31dgPZ3jEV5GRN+Mw+6x09jYgk3dX0AMM6UQ 2XJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y38-20020a50bb29000000b0043e1dce0e27si1351899ede.80.2022.08.05.21.40.25; Fri, 05 Aug 2022 21:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239002AbiHFEDG (ORCPT + 99 others); Sat, 6 Aug 2022 00:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241461AbiHFEDF (ORCPT ); Sat, 6 Aug 2022 00:03:05 -0400 Received: from out28-74.mail.aliyun.com (out28-74.mail.aliyun.com [115.124.28.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 643A214014; Fri, 5 Aug 2022 21:03:00 -0700 (PDT) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.08715575|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.154924-0.00444291-0.840633;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047201;MF=michael@allwinnertech.com;NM=1;PH=DS;RN=6;RT=6;SR=0;TI=SMTPD_---.OnDAFCd_1659758542; Received: from 192.168.220.136(mailfrom:michael@allwinnertech.com fp:SMTPD_---.OnDAFCd_1659758542) by smtp.aliyun-inc.com; Sat, 06 Aug 2022 12:02:25 +0800 Message-ID: Date: Sat, 6 Aug 2022 12:02:22 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] ext4: fix error when itable blocks is greater than s_itb_per_group Content-Language: en-US To: Theodore Ts'o , Lukas Czerner Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, allwinner-opensource-support@allwinnertech.com References: <20220802021029.16046-1-michael@allwinnertech.com> <20220803071859.elywnni2yfol4bea@fedora> From: Michael Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 8/4/2022 10:19 AM, Theodore Ts'o wrote: > On Wed, Aug 03, 2022 at 09:18:59AM +0200, Lukas Czerner wrote: >> >> Hi Michael, >> >> mke2fs is making sure that we completely fill the inote table blocks. >> This is a corrupted image and so AFAICT ext4 is doing the right thing >> here. There does not seem to be a problem to fix, unless you can somehow >> trick mke2fs to make a file system like this. > > Several years ago, android was shipping a bogus/busted > reimeplementation of mke2fs, reportedly because a certain founder of > Android (cough, Andy Rubin, cough) was alergic to the GPL. ("The > problem with GPL in embedded systems [such as smartphones and tablets] > is that it's viral...") This bogus reimplementation would create file > systems where the number of inodes per block group was a multiple of 4 > instead of 8. But, it was under the BSD license, so it was all good! :-/ > > This bogus reimplementation of mkfs would, 50% of the time, create > busted file systems which couldn't be fixed, if they got corrupted, by > e2fsck. This is because e2fsprogs' allocation bitmap code assumes > that you can back the bitarray into a single contiguous memory block > --- and this doesn't work if the number of inodes per block group is > not a multiple of 8. If the file system got corrupted, the only > recourse was to wipe the user partition and the user would lose any > data that wasn't backed up to the cloud. > > This has since been fixed for quite some time, but if there is some > low-end Android manufacturer is using an ancient version of AOSP, this > could be happening even in 2022 --- but that doesn't mean we need to > support such broken file systems. As far as I'm concerned the only > way to make valid Android ext4 system images is the combination of > mke2fs and e2fsdroid, which is what modern versions of AOSP do. > > - Ted Dear Ted & Lukas, Thanks for your clarification. I did several tests, turned outs Ted was right. I'm clear now. -- Regards, Michael Wu