Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2293061imm; Mon, 28 May 2018 05:32:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpstl7ndzuyZYNsGPgFlaAg1RcPby5FKirNv0Xp+Aeo1IjdUeKbcfeHCYsGy24PPPG3qth4 X-Received: by 2002:a63:77c9:: with SMTP id s192-v6mr10485285pgc.140.1527510751027; Mon, 28 May 2018 05:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527510750; cv=none; d=google.com; s=arc-20160816; b=aNkRkx3uZYoDs30shG6/nHg0bb11PEYrAOFGQHEneYgWKfKFaBkxIJ4nTTq1bDGW38 4Z7gG4lnBEXfBN+ANZ6CPC7ak438WiAGUf4mpGtTus3Z4Waf1aV9CnPHi3M1d+M2PTi6 fvpDYTuQOrFBHMfVtS7cK5ZYC6AjHrzgA73unVqfJJ1DcRTGhAh34hlGTVRml+YbcyyE fTFk/Sbvv9BEV6ecTkDLWLr02Tur70NsP36gb91iYc+yoO9cmYkImSF8LjLA7w9lEogW +6x7CEzS9ImrCBTT/n1DxjY9/p/8BvgI5OYuB+FaGwwk9fqWpc7OSDPdy8zg+PsZ+F56 Bvow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=NQxW8QOE/+d5QES1oImbQu8EYzADpEJdSUtmeExXFTs=; b=qomfRIv/d2RmIEL0k7DqJtIifzyCTmcjjfh3Ha3pclW3LMJ2H6caU9A0VSU9XAvRNS xQ8qb12qkOufiGBvVgTggM0vNjkB8bcaWls0AbIcR67+QoLyapPJZu/H2X7Yz4UB8i3t hN21ZJpBiJEcFVq7sbbpyTDyL2qJ0QOimpyYBS5+NPEiXuuPCZNDo41mkLeHw36L+v2S kwcpIgNLtj3fjNUMy7aZsCT1MyeL5/yvd5a1SaWrESRtTEPKAMsDCZwBTiScRVxykBSe Nm3BHg1nUengGmULljQxrD2+3x6iIxh1Bt6rTJQeJ5ruv52Lzm+0PF3uBKVaGce/LXYC lOxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BTKJJlIp; 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 g1-v6si23488900pgq.165.2018.05.28.05.32.16; Mon, 28 May 2018 05:32:30 -0700 (PDT) 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=BTKJJlIp; 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 S938896AbeE1Mab (ORCPT + 99 others); Mon, 28 May 2018 08:30:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:48040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164103AbeE1LAW (ORCPT ); Mon, 28 May 2018 07:00:22 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 8F976206B7; Mon, 28 May 2018 11:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505222; bh=CryrOTS6sWBc4WqSo3m84paZenpqQuhKvv0bb7Mkjzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BTKJJlIpU/fPi2IEny6TF3GNgMNWgzuXyIEEcsej4mdFdtZLTlaxhablbV77WcwFP 7GeO2rbDeFwk08VhwL8yG2g7p3DKFfgbx7epCeA9Vo/RBpySfkn1iX2Q+EZd88yN0y ELbn0EklJvDo+5bRra5bQOc3o+2zCrrpFqzEgyVE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joakim Tjernlund , Eric Sandeen , Theodore Tso , Jan Kara , Sasha Levin Subject: [PATCH 4.14 387/496] ext4: dont complain about incorrect features when probing Date: Mon, 28 May 2018 12:02:52 +0200 Message-Id: <20180528100336.081448905@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Sandeen [ Upstream commit 0d9366d67bcf066b028e57d09c9a86ce879bcc28 ] If mount is auto-probing for filesystem type, it will try various filesystems in order, with the MS_SILENT flag set. We get that flag as the silent arg to ext4_fill_super. If we're probing (silent==1) then don't complain about feature incompatibilities that are found if it looks like it's actually a different valid extN type - failed probes should be silent in this case. If the on-disk features are unknown even to ext4, then complain. Reported-by: Joakim Tjernlund Tested-by: Joakim Tjernlund Signed-off-by: Eric Sandeen Signed-off-by: Theodore Ts'o Reviewed-by: Jan Kara Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3663,6 +3663,12 @@ static int ext4_fill_super(struct super_ ext4_msg(sb, KERN_INFO, "mounting ext2 file system " "using the ext4 subsystem"); else { + /* + * If we're probing be silent, if this looks like + * it's actually an ext[34] filesystem. + */ + if (silent && ext4_feature_set_ok(sb, sb_rdonly(sb))) + goto failed_mount; ext4_msg(sb, KERN_ERR, "couldn't mount as ext2 due " "to feature incompatibilities"); goto failed_mount; @@ -3674,6 +3680,12 @@ static int ext4_fill_super(struct super_ ext4_msg(sb, KERN_INFO, "mounting ext3 file system " "using the ext4 subsystem"); else { + /* + * If we're probing be silent, if this looks like + * it's actually an ext4 filesystem. + */ + if (silent && ext4_feature_set_ok(sb, sb_rdonly(sb))) + goto failed_mount; ext4_msg(sb, KERN_ERR, "couldn't mount as ext3 due " "to feature incompatibilities"); goto failed_mount;