Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2252179imm; Mon, 28 May 2018 04:49:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpvA/k7RIEWUnnPynsI9zq8Fo4deWUt0JmiibHFs6dS8e3viswCBUwDqMj8yVpJcwAoYSLL X-Received: by 2002:a17:902:a512:: with SMTP id s18-v6mr13280183plq.223.1527508149385; Mon, 28 May 2018 04:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527508149; cv=none; d=google.com; s=arc-20160816; b=PVUcx+RA96igI49pHr5vD5NF84U+VLd/7Jn+A+rBHD4AwKVivu2HkXDbj9gj6hn7R4 mgJQHJntwxabbVIhTkZTICRHcTUJa+8boyYc5ReqBb6ibbwnKxwgiROW+5hTFjRZkvuO 7IYE+GLsmlHfADv6Stg/v2HyPr54cvdEv31qyebyStp22OmBEt6sqloMUfLFlaE+dKCe r/4TqD9QoBk7XAkzbf4p3wvPqsj0RVLzwddMqPV3vWsdKvt//R7THj0rRjUTSvOrz1V5 b18jiW3PDtwBTP0dNlig0Nt0gV49fRW1fmxK9fS9q0qYZarxdDx1PbL96mTgOrSmu2Dm O1Lw== 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=LaR2NERBNr8h0gco6KiAyo9MFEKfLQ0/1l/k43qhaY8=; b=w/S34EryAZ+T4VIJMUy6B50R7OyUJb8R3y82Xh5GoJrYM7AQcqnPqwMJBpABMCtrga 5MCkq81N+sh9izQDtaUzl7YG5iJwkFVJ1jFUW232vFuTvxIMNXv/6fdS7sRnccuG7y7S uBb1PQNufxCVwnEfrzyN17xu99IAf76xH6F3+kM/FzQMmj1xY/qwoUHv/stkl5wDNwU1 WS3d8K27+CL+xsHGuZAwJWOYX458ZAPJxvNGc1EbxHHUIkqaaZk7R7avZFsjuXS8c0EF EhaaeKB8RKGBLC5h2OMDUOfAEE1wibQi9odPGjG6IKjIMZTyDJeXK9kFSZ33p3Mf4YDQ yHZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cZIq+5gS; 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 bf3-v6si30408130plb.105.2018.05.28.04.48.54; Mon, 28 May 2018 04:49:09 -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=cZIq+5gS; 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 S1423893AbeE1LK3 (ORCPT + 99 others); Mon, 28 May 2018 07:10:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:58390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422749AbeE1LKU (ORCPT ); Mon, 28 May 2018 07:10:20 -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 BE0212087E; Mon, 28 May 2018 11:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505820; bh=9wJvOLr7SEkHDVrQIXs3RQd4io9qrUKRJ+U8XI7KnME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cZIq+5gSScnxgnfUVHVPOrcAvGlBHRe94PhTiaTKXF/nf2riRB6Q4AY2PVQyYlNwE DgQU5tD4ccCEK+F/OYWs8cAcdSM95M9JIOL3CWPP2XhsQ5/4quunhcG8A5vMPWeH1q /H+t/CQqJrXjsWAmUFjNSY08uNhp0rOdmlxHd6Hk= 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.16 140/272] ext4: dont complain about incorrect features when probing Date: Mon, 28 May 2018 12:02:53 +0200 Message-Id: <20180528100252.805459949@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100240.256525891@linuxfoundation.org> References: <20180528100240.256525891@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.16-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;