Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp115809ybv; Thu, 6 Feb 2020 19:13:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwRjmlazkf5ZozdfDdzhyDjC7TciIum283FPiT/QCdXrhIt+Zxq7lALqN+OOsl3N8LD2XPU X-Received: by 2002:a9d:7410:: with SMTP id n16mr1081914otk.23.1581045238738; Thu, 06 Feb 2020 19:13:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581045238; cv=none; d=google.com; s=arc-20160816; b=olu1urPIz3AxeLe1Ufv46IaFJrmmXRpIsg4GnBoCKkSQA0MV8ehoDX9RXYa2qOIMdS zHNPV1TaAd0WVDDTfyl1xvtRHAqVd5OJSKe452kN08naOWf7mU6dR9nuQLs84Z83YJu9 US0bLFUlXfnlXLYDThOv8M/4txLCfiAhWwF/sQ8jMxE8LUGOVBUNqXXupWOzE/EWPg8l bXXdFU4424W3rKu+4/BhIXG223wCBYlWR4NvT1RlItho1HiZ+LcbLoWgaDO6VSuYeVLm mcRBV04OyUVQfvMTRzffBdXfQURekFvGcMEaleVLlAPGMzKDviG4nicN49roFzT/XPPP GUvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=T59xL1yg0OpdFKsrkEtp9wXXbKvSacgmmIRq9c2auiA=; b=HkONUrKvbTal+O4C5lnkuz4+QfOArkvNa+RfkVMUTnVsPptTXEqr/KhbxniZLaACL7 EucQJzIr8EhBcZ4Fhk3MUezQNC3EF2C93fSk/amIXpqNqWQqjv2Q3QgPwpoYHNkaL3K3 TKdLIm8zNo92h2JacvNLfW4qDt1T28ALxhSkyfJ2SifEF8uMaxduU82oz/0pmAPVjJCX 34GKW+NULGQUuJ33UaXY0g7WEGb5F9gGpv852ehBUSbN3IH/+HpqIdpS1fkEWjp4Za2c 6MBCQyPVwgiDUbda53/Dc0MAKUoKsJKwYXVKMYBC5fPGSxtZq+yzkUfrEZ2QkNFaF3A3 LReA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si3152708oic.188.2020.02.06.19.13.35; Thu, 06 Feb 2020 19:13:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726628AbgBGDNb (ORCPT + 99 others); Thu, 6 Feb 2020 22:13:31 -0500 Received: from MAIL.13thfloor.at ([213.145.232.33]:58376 "EHLO MAIL.13thfloor.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbgBGDNb (ORCPT ); Thu, 6 Feb 2020 22:13:31 -0500 Received: by mail.13thfloor.at (Postfix, from userid 1001) id 0B9D416309; Fri, 7 Feb 2020 04:13:26 +0100 (CET) Date: Fri, 7 Feb 2020 04:13:25 +0100 From: Herbert Poetzl To: Andreas Dilger Cc: linux-ext4@vger.kernel.org Subject: Re: EXT4: unsupported inode size: 4096 Message-ID: <20200207031325.GA27737@MAIL.13thfloor.at> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Feb 06, 2020 at 10:55:04PM +0000, Andreas Dilger wrote: > --Apple-Mail=_7CDF64A9-C7FD-4E08-9AB4-1843C57439EC > Content-Transfer-Encoding: 7bit > Content-Type: text/plain; > charset=us-ascii > On Feb 6, 2020, at 8:35 AM, Herbert Poetzl wrote: >> I recently updated one of my servers from an older 4.19 >> Linux kernel to the latest 5.5 kernel mainly because of >> the many filesystem improvements, just to find that some >> of my filesystems simply cannot be mounted anymore. >> The kernel reports: EXT4-fs: unsupported inode size: 4096 >> Here is a simple test to reproduce the issue: >> truncate --size 16G data >> losetup /dev/loop0 data >> mkfs.ext4 -I 4096 /dev/loop0 >> mount /dev/loop0 /media > Does this still fail if you also specify "-b 4096"? mkfs.ext4 -b 4096 -I 4096 /dev/loop0 mount /dev/loop0 /media [66723.456449] EXT4-fs (loop0): unsupported inode size: 4096 >> [33700.299204] EXT4-fs (loop0): unsupported inode size: 4096 > It looks like this is a bug in the code? This check is using > 3641: blocksize = sb_min_blocksize(sb, EXT4_MIN_BLOCK_SIZE); > 3782: if ((sbi->s_inode_size < EXT4_GOOD_OLD_INODE_SIZE) || > 3783: (!is_power_of_2(sbi->s_inode_size)) || > 3784: (sbi->s_inode_size > blocksize)) { > 3785: ext4_msg(sb, KERN_ERR, > 3786: "unsupported inode size: %d", > 3787: sbi->s_inode_size); > 3788: goto failed_mount; > 3789: } > which is set from the hardware sector size of the device, while > the ext4 filesystem blocksize is not set until later during > mount: > 3991: blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size); > It looks like this was just introduced in commitv5.4-rc3-96-g9803387 > "ext4: validate the debug_want_extra_isize mount option at > parse time" so it is a relatively recent change, and looks > to be unintentional. > This check was previously on line 4033, after "blocksize" was > updated from the superblock, but it wasn't noticed because it > works for all "normal" filesystems. > I suspect nobody has noticed because having an inode *size* of > 4KB is very unusual, while having an inode *ratio* of 4KB is > more normal (one 256-byte inode for each 4096-byte block in the > filesystem). Was the use of "-I 4096" intentional, or did you > mean to use "-i 4096"? > The only reason to have a 4096-byte inode *size* is if you have a > ton of xattrs for every file and/or you have tiny files (< 3.5KB) > and you are using inline data. Indeed the filesystems in question have a huge number of small files with lots and lots of xattrs for each file. IIRC, back when I created them, I ran some tests iterating over various block and group sizes and simply chose the one with the best performance over a given testset. >> Note: this works perfectly fine under 4.19.84 and 4.14.145. >> My guess so far is that somehow the ext4 filesystem now >> checks that the inode size is not larger than the logical >> block size of the underlying block device. >> # cat /sys/block/loop0/queue/logical_block_size >> 512 > Yes, this appears to be the case. We have LOT of filesystems that > are using 1024-byte inodes, but I suspect that most of them are on > devices that report 4096-byte sector size and/or are running older > kernels that have not included this bug. >> Any ideas how to address this problem and get the file- >> systems to mount under Linux 5.5? > Probably the easiest, and likely correct, fix is to move the update > of "blocksize" from line 3991: up to before this check. > There are a bunch of sanity checks that should also be moved > for a proper patch, but the one-line fix is enough to get your > filesystems mounting again. Yes, I can confirm that moving line 3991 before the check fixes the issue and the test as well as the filesystem mount passes without problems. Thanks a bunch for the quick and accurate information! Appreciated! > Cheers, Andreas All the best, Herbert > --Apple-Mail=_7CDF64A9-C7FD-4E08-9AB4-1843C57439EC > Content-Transfer-Encoding: 7bit > Content-Disposition: attachment; > filename=signature.asc > Content-Type: application/pgp-signature; > name=signature.asc > Content-Description: Message signed with OpenPGP > -----BEGIN PGP SIGNATURE----- > Comment: GPGTools - http://gpgtools.org > iQIzBAEBCAAdFiEEDb73u6ZejP5ZMprvcqXauRfMH+AFAl48mUgACgkQcqXauRfM > H+ASGg/8DycAju0NbXzVaKiOvovbvjZRyJq7nF6M+KBJevm0928uLjg8qkWvIdXp > Jj1AM93mikp4A/BULggBBpa8wOCIG9Z7bx1tATaQrvQh/3cI5KuWd7ssfTR9INWJ > yzgZ1Y/1vjwiU/YD1i922CK4M3sEwmB5fzrNC/H9HruwHpuMe0ek44lNmsuNPjGh > c+hBkTFlmOPF9n9bW4mr2Da/v1BA+ffSI2NJW3TejR7k6UvvNKWpLrbzheMSMVCf > y5xuD9mWuh/1FL77tdDfDVbPo6VRS6I1JBoz14EUl9mz6IrCWulVgIIi/7NzRviF > onDLo/t3pA/2Yx5G+AAVsIM9tClXXGbNT4WquU2vrO9CdnuRT6rr1pc8vKCz7lch > 2US+UhmorTVVd/NeXQMxT2i6NPNbRsoaBqxP5TcLAtp8b5aDAUCUSAHyIEWtoydm > GRPRfXZJauqBYDffGdBWsvsMmepceMC4CMiezfoIWBbfnMfH8wVI+D3qEO6gLDkr > sNm1/dl/7BfIFjF3ndItsgKTVCGIiFgQ86juEDwDwO/+UB9O9K7nngoEe0ZLt/sy > Kn7RLdkOGR689vc/1WArbM31HntWbp88xTe3s2tPlWv4r9hVZebZXFIAYrwvqviS > NrZwqOyjeAmlHWJcqaXQS7kV6tYDpT6Je7weNgZmQA1Xc7Ig12o= > =rKs+ > -----END PGP SIGNATURE----- > --Apple-Mail=_7CDF64A9-C7FD-4E08-9AB4-1843C57439EC-