From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-co1nam03on0109.outbound.protection.outlook.com ([104.47.40.109]:37278 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753603AbeDIASd (ORCPT ); Sun, 8 Apr 2018 20:18:33 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Anand Jain , Anand Jain , David Sterba , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 064/189] btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP Date: Mon, 9 Apr 2018 00:17:35 +0000 Message-ID: <20180409001637.162453-64-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: 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 --- fs/btrfs/disk-io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index a8ecccfc36de..3353d3de726a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3910,9 +3910,11 @@ static int btrfs_check_super_valid(struct btrfs_fs_i= nfo *fs_info) btrfs_err(fs_info, "no valid FS found"); ret =3D -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 =3D -EINVAL; + } if (btrfs_super_root_level(sb) >=3D BTRFS_MAX_LEVEL) { btrfs_err(fs_info, "tree_root level too big: %d >=3D %d", btrfs_super_root_level(sb), BTRFS_MAX_LEVEL); --=20 2.15.1