Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2045123ybv; Thu, 6 Feb 2020 14:53:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxukoMEJut9fJLM+78OFCOJWWD+W16RZlZo5AuWUZndQbheZ2U7I+ERT95cnpcXqF5pBODk X-Received: by 2002:a05:6830:200d:: with SMTP id e13mr351260otp.364.1581029611844; Thu, 06 Feb 2020 14:53:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581029611; cv=none; d=google.com; s=arc-20160816; b=olQ+vRPkw3rj8xQyZt4pO7iFJmSf3myj5ZN/BsIS7JF/smTk6WbIJQM4mCTj0nzS4n QaBjyZx5kYasm3nRhRdngnOLJsqJAw6PxYv1UHjG2mpFF2jQwEf7sRUwtc5lofmpwLq3 ytS6ie5kJiAKK6g4Sqxgeul9uk/Il/9ciicJxu28dGkQYgCSB6ZBR94lsZslXrzvyHvd tiV6PRj6qYT0gZ0nTRI9Kf97XrhWmJ41ctO2HES6B9o5vgmcUT46wflQwgfPahpLOyNZ HQAW3mLI6OJTUcc+saM5iK+g4Og4OE0OEsHQxAtPJTNnUWRpSMcwIM0MuTkhaA8c46TD ANsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date; bh=o31OjPosxX/rXACsVLfzDSQfrGWlhjQ60Q0/rrQUa8w=; b=W2GWF5nRGsZdBNYgyUc6q1PxNQBb3GCFHOwRDllymGdjzALvZDPxOsG4qAHYz+TGDo q5+d7KlvMsePtIGgNILgJNjSN8m9rtlBjhV8843M5pSkehOgZQdgEDw2o3cYUW8H+6lA 2ewkIEK35RRaW1+okfYM8toKwOOXBhVR9pudfuivQrDYcnDTJmnzZL0VWaaeUr0gZ4eZ ejvgFzskl89/HKE8kpFIczwVicBxStO8cHb80eGOBQ99ekZrxAdSCEWgkGXchsTOWSfD 3p6GjLWzGvwy85e/8H9uOX6JjkUAhJJHzTXBUz3vECaF80o703WX23i+3zVIAzLFt1Rl /5eQ== 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 d8si565061oti.306.2020.02.06.14.53.02; Thu, 06 Feb 2020 14:53:31 -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 S1726543AbgBFWw7 (ORCPT + 99 others); Thu, 6 Feb 2020 17:52:59 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:33102 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726502AbgBFWw6 (ORCPT ); Thu, 6 Feb 2020 17:52:58 -0500 Received: from callcc.thunk.org (guestnat-104-133-0-101.corp.google.com [104.133.0.101] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 016MqrrW014535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 6 Feb 2020 17:52:55 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id BE9D9420324; Thu, 6 Feb 2020 17:52:52 -0500 (EST) Date: Thu, 6 Feb 2020 17:52:52 -0500 From: "Theodore Y. Ts'o" To: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: EXT4: unsupported inode size: 4096 Message-ID: <20200206225252.GA3673@mit.edu> References: <20200206153542.GA30449@MAIL.13thfloor.at> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline In-Reply-To: <20200206153542.GA30449@MAIL.13thfloor.at> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 06, 2020 at 04:35:42PM +0100, 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. Thanks for the bug report! This was actually a regression caused by recent security fix (which landed after 5.5, but which backported to the 5.5 stable kernel). The following should fix things. Please let me know if you still have problems after applying this fix. - Ted --envbJBWh7q8WU6mo Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-ext4-fix-support-for-inode-sizes-1024-bytes.patch" From e0c963ab41e21bea32565a36654523687be3e7f0 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 6 Feb 2020 17:35:01 -0500 Subject: [PATCH] ext4: fix support for inode sizes > 1024 bytes A recent commit, 9803387c55f7 ("ext4: validate the debug_want_extra_isize mount option at parse time"), moved mount-time checks around. One of those changes moved the inode size check before the blocksize variable was set to the blocksize of the file system. After 9803387c55f7 was set to the minimum allowable blocksize, which in practice on most systems would be 1024 bytes. This cuased file systems with inode sizes larger than 1024 bytes to be rejected with a message: EXT4-fs (sdXX): unsupported inode size: 4096 Fixes: 9803387c55f7 ("ext4: validate the debug_want_extra_isize mount option at parse time") Cc: stable@kernel.org Reported-by: Herbert Poetzl Signed-off-by: Theodore Ts'o --- fs/ext4/super.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 88b213bd32bc..eebcf9b9272d 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3814,6 +3814,15 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) */ sbi->s_li_wait_mult = EXT4_DEF_LI_WAIT_MULT; + blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size); + if (blocksize < EXT4_MIN_BLOCK_SIZE || + blocksize > EXT4_MAX_BLOCK_SIZE) { + ext4_msg(sb, KERN_ERR, + "Unsupported filesystem blocksize %d (%d log_block_size)", + blocksize, le32_to_cpu(es->s_log_block_size)); + goto failed_mount; + } + if (le32_to_cpu(es->s_rev_level) == EXT4_GOOD_OLD_REV) { sbi->s_inode_size = EXT4_GOOD_OLD_INODE_SIZE; sbi->s_first_ino = EXT4_GOOD_OLD_FIRST_INO; @@ -3831,6 +3840,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ext4_msg(sb, KERN_ERR, "unsupported inode size: %d", sbi->s_inode_size); + ext4_msg(sb, KERN_ERR, "blocksize: %d", blocksize); goto failed_mount; } /* @@ -4033,14 +4043,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) if (!ext4_feature_set_ok(sb, (sb_rdonly(sb)))) goto failed_mount; - blocksize = BLOCK_SIZE << le32_to_cpu(es->s_log_block_size); - if (blocksize < EXT4_MIN_BLOCK_SIZE || - blocksize > EXT4_MAX_BLOCK_SIZE) { - ext4_msg(sb, KERN_ERR, - "Unsupported filesystem blocksize %d (%d log_block_size)", - blocksize, le32_to_cpu(es->s_log_block_size)); - goto failed_mount; - } if (le32_to_cpu(es->s_log_block_size) > (EXT4_MAX_BLOCK_LOG_SIZE - EXT4_MIN_BLOCK_LOG_SIZE)) { ext4_msg(sb, KERN_ERR, -- 2.24.1 --envbJBWh7q8WU6mo--