Received: by 10.213.65.68 with SMTP id h4csp2153485imn; Sun, 8 Apr 2018 21:05:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9pQXK62prvFT+COYm901vHySFXNUwtElys1LKqL1r3Alul3/vmKDtJkPm6TgywVFhUoXH X-Received: by 10.101.71.194 with SMTP id f2mr1986141pgs.312.1523246737879; Sun, 08 Apr 2018 21:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523246737; cv=none; d=google.com; s=arc-20160816; b=ynra08pMfISIGf4CEG3cn7K5Uq52Z3/bhPdfwQk4k4E38R6bmHvlYiYVbzO8lqoVmL bcbPatq8pJXW8kz5t7JA0famIcynE/N6sdIj2Vvo8wYgRM3+rjLl3fSmzwTs29gzrdyN Dp7SxRdHoSvGokC1I11mpBtCFvYT7OI2tlvcQ3RJ2OZc8iqzXfO47kei6QrlnRXUQ8LH SNpK71CJEl7x8VsF96yA52RsEYvrc4Chs/x6GF3xizpbEu1+hjv9ly0icFlj8kpjK7bS xZy6Ig4UeZ4OCvnWEYQU0fX0rxZzinpvkUUYKm9Qs8AbeHl7v8FC09G37F9xNqlhatqm cLzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=UmlLDbfp4fSp7kSkOg2ge47Xxul6jEn/QjWe4KcbOlQ=; b=H2FF9J7YKw2/2Yj8wlhCdlb4FECth/p/XzwQQLPnEJeULPiaN2KQuKnO8aty30TZ0l 2RCLjLwbsOrR5gqEyPPe2HaPg7kwSZauNjq/4ep14OBK1HIfaNJukF2NAEfc7JncrQRM 4zCr1DciChFQgzTFSiWX2lilAsMy94gl4HzkTaT5W5u9S5b6g8EsOicWg0vBbds0f4AB WY1kSGCFuZtWvcwWPNRgz2RXXNnYK4tVXaSzoGJndtDvfaKvZ2jNjOgTvaYPIimNNX7H kPVikOLuUti8aamM3iEAAmtD5uB1vY5IxsvBo9JxhFar14hTwhyDmOHJplGRdUMHeXaJ uJTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=mHP6H6Mn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8-v6si14094041plr.477.2018.04.08.21.05.01; Sun, 08 Apr 2018 21:05:37 -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=@microsoft.com header.s=selector1 header.b=mHP6H6Mn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751669AbeDIEAF (ORCPT + 99 others); Mon, 9 Apr 2018 00:00:05 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UmlLDbfp4fSp7kSkOg2ge47Xxul6jEn/QjWe4KcbOlQ=; b=mHP6H6Mn8e1+DIRNMRpElYrpI5ZO4ryVw6jNEZzVP8bn6d6oFsXUpNS6ZmIpZE90EvVT0iiPUXEKLH5kb6ZiTRRDUdrtol4owhHenJlmjYps+e9BjpCzw/+h5jZAxSI1vtK5JVnR9MSwu6slGwMRDI52P2RfXU7hzXH0M1P+U78= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1046.namprd21.prod.outlook.com (52.132.128.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:18:29 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:18:29 +0000 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 Thread-Topic: [PATCH AUTOSEL for 4.15 064/189] btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP Thread-Index: AQHTz5gpd0Mzikat/Eu5QXAWvDiCUQ== 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> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1046;7:I3OkYdFcLKJIMxh1hGDppOmxKnAMgobYABfPx2cSfEtYMGmqJWS8a2BZwNxFszaDFt3V/xsKQfam3LH9WPQotemiYU+7BpxXdODd+zgEnH8nmrFWfYrDartoYajQ0RQJXm+mUVCrWDpggGnnefUGlTZRh4WoGavWRzMMMeEkq4z0S4OU940kN1p7+8NlL+jh01sqs4EFe6M36DMFqrye8WQF1IYnDaxZzRK1v0e+CJOnF+Lu1t1xBCVueiQenNez;20:DItFLEV+4F4v27kgdLvR0HSP0LG2WPVlWLOA2QS/Gl5Jd8QE2HmvPpoVPQtSQlKdh6GnknXXwgFg00+B0vpa/j6jtX+l82eSdrHRxQsQPyUxSZq9mW+xvvia9Hb0hnDzcDpy/OyHx3Upwmf6ZxCs7pSpB41QrAHfEymSlD9Q74A= X-MS-Office365-Filtering-Correlation-Id: 6d52136e-06a8-4ed1-2af2-08d59daf6bc9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB1046; x-ms-traffictypediagnostic: DM5PR2101MB1046: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1046;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1046; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(346002)(376002)(396003)(366004)(39860400002)(199004)(189003)(36756003)(575784001)(186003)(11346002)(446003)(476003)(2616005)(7736002)(5660300001)(26005)(10290500003)(478600001)(106356001)(6666003)(68736007)(10090500001)(54906003)(3846002)(59450400001)(22452003)(6116002)(86612001)(110136005)(99286004)(86362001)(72206003)(305945005)(76176011)(102836004)(6506007)(486006)(316002)(3280700002)(3660700001)(81166006)(81156014)(8676002)(2906002)(14454004)(2900100001)(97736004)(6486002)(8936002)(1076002)(6512007)(6436002)(105586002)(25786009)(4326008)(2501003)(5250100002)(53936002)(66066001)(107886003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1046;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: oM/me1+Jw0vy+mimdzvVZQx5wpfN829+g09Zmzx7E/xKJgV6u2gt2QvOxkgQIw3xuwluux7wvGkR0HOs2f481ET6Mk5GxPNHVE+NlzIuRQQVtQjJPPTVEeacU7OAOZ09ViYR7q3hI9HODUQO1WlW2/mAQSQ/Hu0B39fLXjMdBqBNHqMMwKgvuIsj9/HNscUfLUYFt01gb3LWvALB5GTrcS8eZnzyPL0LjSeMAQJfFt6Tfk8IVxD6J/t9byGUqKRrm37pxBOVSx4LTYgYFanAa9KryRfzLVI07oM87/CR6Lo+at7lP56BhyPNR8c+8V59TQJxYzDueIREYkZ/5slH8da1udESwbQlicxQ8rDcFmUzkcxPzDZoim+3ltxAVoYrTZaitWx83F4RcXxH0DSw7kgLR0SV3lcw0Y280FMsYbU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d52136e-06a8-4ed1-2af2-08d59daf6bc9 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:35.7120 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1046 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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