Received: by 10.192.165.148 with SMTP id m20csp551943imm; Wed, 25 Apr 2018 04:08:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx49AIbCCHwa/36X1Fs/Kb3uUuQUWRSYT7jTjmJTJ3Q6NDoobUz7iYMjo+9J2rh3D/bdtQBqQ X-Received: by 10.99.105.196 with SMTP id e187mr19800023pgc.415.1524654501842; Wed, 25 Apr 2018 04:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524654501; cv=none; d=google.com; s=arc-20160816; b=m4ZUGDOnfptUrvvoVCmaqlCA7LSfqqCojib6ktLR1Yj8H4cufHFfqj6hgH6Fu5oj4i L9Yz15YMrS1/qg1UFDGe0SYwd+Lfi491FNfs4cJDBkumwGA58ghBYsQDcU2OK5cd+bCm NZCwq/hgwIC52chlrA2GoZTHwsEKOaML1ROSVRk2W4LWmGdFtdKfSwSxfg/KeCQAESoF gCUfSGaj1xCYzBCUAYDi5gZkRhfLgnXYOge/ee2NLUWy292lX33dve1L5/ZzBjw/Xy+s SJfDgvB3EnTB5JaWXRMkzWD5GLHbiTWtl1Xli1KkLaItiZPvWBnrRJZz57vKu0PFzCRg QN0A== 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 :arc-authentication-results; bh=xt6iHrR/0nzpNgxsgZpKENP9aQlkVz+NcmI+2nnL5iY=; b=vIF+6UiwcdMfxyZqaM4YIF5Hdw+9JfHXGO0DFXR+31C14CN2dWxYyXxUA+UmHF1gsV wtLef1EEz7IggB7WGd+FX3eQZfaaG+szDzK57Mgb/zzb2ua1w8CU/6jHmcCObWRfMrc3 rZyPMFdes2dMPGxvNKR46EVFcYs+pVKYMyT8GV/G8E0ygj2fD0CNKu6NLE662H8yj7vk 1Wp5wAKwUDlVY72aNMxwpl+x1C7MvNN14gTXlC7yfuvVDJ11GgPt7PEkLJvDXTFi3VWj IrYJqTO868D2gcPHB8KzHckMKqKXxfy4Y+lA/zC8H7ibwZBFaJQFHdBZtEP8NhJXo0pF dI4w== ARC-Authentication-Results: i=1; mx.google.com; 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 v14si13474042pgq.266.2018.04.25.04.08.07; Wed, 25 Apr 2018 04:08:21 -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; 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 S1753995AbeDYLHH (ORCPT + 99 others); Wed, 25 Apr 2018 07:07:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52454 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbeDYKlo (ORCPT ); Wed, 25 Apr 2018 06:41:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 015CD480; Wed, 25 Apr 2018 10:41:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anand Jain , Qu Wenruo , David Sterba , Sasha Levin Subject: [PATCH 4.14 066/183] btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP Date: Wed, 25 Apr 2018 12:34:46 +0200 Message-Id: <20180425103245.176575157@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@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: Anand Jain [ Upstream commit 6f794e3c5c8f8fdd3b5bb20d9ded894e685b5bbe ] It appears from the original commit [1] that there isn't any design specific reason not to fail the mount instead of just warning. This patch will change it to fail. [1] commit 319e4d0661e5323c9f9945f0f8fb5905e5fe74c3 btrfs: Enhance super validation check Fixes: 319e4d0661e5323 ("btrfs: Enhance super validation check") Signed-off-by: Anand Jain Reviewed-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/disk-io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4063,9 +4063,11 @@ static int btrfs_check_super_valid(struc btrfs_err(fs_info, "no valid FS found"); ret = -EINVAL; } - if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP) - btrfs_warn(fs_info, "unrecognized super flag: %llu", + if (btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP) { + btrfs_err(fs_info, "unrecognized or unsupported super flag: %llu", btrfs_super_flags(sb) & ~BTRFS_SUPER_FLAG_SUPP); + ret = -EINVAL; + } if (btrfs_super_root_level(sb) >= BTRFS_MAX_LEVEL) { btrfs_err(fs_info, "tree_root level too big: %d >= %d", btrfs_super_root_level(sb), BTRFS_MAX_LEVEL);