Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6214652ybv; Tue, 18 Feb 2020 12:10:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyzWq/880/F9QcCepTJyWzZ8CrO/wyw0lP42YIjPHKHHvVtf4MC41d562bNtFV8gEnvvBHY X-Received: by 2002:aca:afd8:: with SMTP id y207mr2300711oie.96.1582056609496; Tue, 18 Feb 2020 12:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582056609; cv=none; d=google.com; s=arc-20160816; b=0MAEugnSwm0AA6oNL8UAR0Gb/Q2GweGGnEnNguKJgnamSfmIxREkcwWG3qfEloE23s AeQWjhjW2hDg+OEZnXScvlqoj0hGcSGraq5nG33HwHNpXp7ulI8wATR/yQ/G8T4N5+pg Q9VggaG6+e9Ym7tUreZjq8DXtLFQEX9wqSxUyVCqK3KHb6775RlTEbb1jLaWlSEk6GWU Tg1xc8PEtY8XZo5JTz+RYhOFzAP6an3yKdvjg1MP7U8VFMLOCT/3iKpLod2eKz0KXYm1 v1ZJfkgcCdmMtt554godafFanl6g0JISs3glo+IBP2ORcGm45c+JR2FCbBwK6XBmgmyJ h68A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sPnHROfvDZ9MAnzq1VXh6U0Yl2IrlCrt/zleXHzz+Eg=; b=rX4d7EM7zFjP6nHNEBV4pOFMIzsX5el+DKqOz+WAzgn5MIpX2R4H38oQpNi4B6drn3 0E6ox/thp96WXkJnUOiDRAffSEjXw/a9OXHS/8GffYU7msKQvL9BKj3ogNISEpzLYuhY vxQd9+f256KRyoK1a2+h3H0xxglfvl4gVwLsG8txTSFhXtEIwOHgv1/2lMigEiWEqZAw FEdwrQ229RfE3cUJTt0FU6zrEGpw1Y4ZI7erJ5A9yVPii7M9RsArUxDyxCP52K5dpvP7 neaLDVIlqKlFnjyUkcM14gpQGqba0oRuPqpAOdvoOJJjv8hOZdflUD4e3yXOmjgQFW3q rKfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rVLW5abD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 l5si2156935otf.37.2020.02.18.12.09.56; Tue, 18 Feb 2020 12:10:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rVLW5abD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726754AbgBRT4G (ORCPT + 99 others); Tue, 18 Feb 2020 14:56:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:33010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726750AbgBRT4E (ORCPT ); Tue, 18 Feb 2020 14:56:04 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 28BBC24125; Tue, 18 Feb 2020 19:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582055763; bh=XAjfuARNC/Cw5F+F4EAelUBaJnSK7AIraW+t0yZ0Hs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rVLW5abDjtDMRWJxgZtnRJjlXNjn5yR+PHpDWTTdBxZQwEUbJ+dPMKLkO9W4w2AEz Y2zVryMSwbE3phIO2ys1aIcdHxR/w6qEEkhHUVUFktDVzAIQWz3y0kjVYASoso8Dal X+iDlO9U+cr7UVz9TcCllOl8M0x7cifilih2hhk8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Herbert Poetzl , Theodore Tso , stable@kernel.org Subject: [PATCH 4.19 12/38] ext4: fix support for inode sizes > 1024 bytes Date: Tue, 18 Feb 2020 20:54:58 +0100 Message-Id: <20200218190419.997305889@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200218190418.536430858@linuxfoundation.org> References: <20200218190418.536430858@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Theodore Ts'o commit 4f97a68192bd33b9963b400759cef0ca5963af00 upstream. 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") Link: https://lore.kernel.org/r/20200206225252.GA3673@mit.edu Reported-by: Herbert Poetzl Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3727,6 +3727,15 @@ static int ext4_fill_super(struct super_ */ 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; @@ -3744,6 +3753,7 @@ static int ext4_fill_super(struct super_ ext4_msg(sb, KERN_ERR, "unsupported inode size: %d", sbi->s_inode_size); + ext4_msg(sb, KERN_ERR, "blocksize: %d", blocksize); goto failed_mount; } /* @@ -3907,14 +3917,6 @@ static int ext4_fill_super(struct super_ 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,