Received: by 10.213.65.68 with SMTP id h4csp2114216imn; Sun, 8 Apr 2018 20:04:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/gOhMDfSpgnN4Omvr6Zwe5a8EXY/DF1BcBxuCrKipYRGiQDAU4uvlzH05LeluBgXINhss2 X-Received: by 10.101.82.10 with SMTP id o10mr23949363pgp.148.1523243064750; Sun, 08 Apr 2018 20:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243064; cv=none; d=google.com; s=arc-20160816; b=DNa0NBaIEr6K0/Vj1APOw5qItMvo6ojYZkfC1wR6yHBywYdVdti37WdcJq2H5+d2EE sX5YNLYpl0JYHErodLZGzsdAYt1+FZAEWkwPaLmnqGfr7atE/3yBcTjsm6I5AZ2wl1SO 2/l1bjS+yZPDIcPlgOZ8VpkuIAoVs6EzAXY5XCh65dmjdTIiX4GH30auGxiT1Ive7c5+ gts2EU5CHroRq/cvwJ+D9yfllWqCOmTssdGSgJr04DEcmSVYxSVYNf11jF4GaUUJK80p 9qPlfJQpeVeytDAzUEap7CzdxoIG8GniNOz8YmN2G7EeIqmYJtoHYKLStyNQerJXRdjV peag== 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=LMbO8edCImGlEGQAc6JaQjBdI4JlVCeUdfX18PzhNDM=; b=G5PX5ZvhqPTURzCS/FOzTgZ97ryWa6KzOi0nIzGSc7GT+rWvhXmOYTT3ikbFehitXE KHqYOWQW/A64YtXh3XKyqNZKN+INE0p33KcPrQ2p6Okx5VxJK2WOlOA/nqkqmoZFjmO/ Z42BX9W1BtjZp3SGIhz+HfjDB74fiy5+EgXix5frXYUbGizi8lV82DqHlPoTw86Rk6Dj ynO77IaZ8UQqeCVKuQ8P1hI9NBStabWZAn+23pLm3jv8T7KawzT0dRrW+kLOluOCzbdS n7gUUeAdcCkwmow3h2vaakysM9vGAFafCulXbDd5sjYSTrvy5/nJ1v84bBIQWVfrlLma eQzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=P+iPz4fZ; 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 97-v6si13774297plb.383.2018.04.08.20.03.47; Sun, 08 Apr 2018 20:04:24 -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=P+iPz4fZ; 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 S932309AbeDIAd1 (ORCPT + 99 others); Sun, 8 Apr 2018 20:33:27 -0400 Received: from mail-sn1nam01on0094.outbound.protection.outlook.com ([104.47.32.94]:49836 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932287AbeDIAdQ (ORCPT ); Sun, 8 Apr 2018 20:33:16 -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=LMbO8edCImGlEGQAc6JaQjBdI4JlVCeUdfX18PzhNDM=; b=P+iPz4fZU22/43lDiYOT0brSnFk/uVnTMICQ4gztKGNsr1l6VBDECRbeuCDUcOatiEv7el93iu5PGn6Dw6rx1lOe6SveJzX5o1SeTtkHtQ8SuDWlp5boy4bapMUlZO3UP05cp9Jjd8uFXp+FDWxNc15ljDQh+keevbkeWph5HRE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0902.namprd21.prod.outlook.com (52.132.132.159) 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:33:10 +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:33:10 +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.9 240/293] btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP Thread-Topic: [PATCH AUTOSEL for 4.9 240/293] btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP Thread-Index: AQHTz5lVNbgUQvjwq0iJjdR1AXfTDQ== Date: Mon, 9 Apr 2018 00:26:00 +0000 Message-ID: <20180409002239.163177-240-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0902;7:FmQ3XjOhR//Lwa31pKV0+AirjfUfDz3duQFWx+j+faKlWCwQL9ZYi/JvqJp2SAxn7rpKLiecMtgHnfB5vwEXdP+al1VgrErQesik6IIzHflxGR3TNnsonkmmS5L49Zc8ZouzSw21vsrsdArqKnwlyU635jnOnrWM+hb/1TQUDl3C9Xa+J+b4YvSb1okpAZT59OrrcwAcyyiqbblkYqKELuh5vHSvmWBtnT20P5Y//m8N/hiBN7Ir8igXGUgh9KlE;20:eYeb2dCvNie8W7OSGcEkTEXq/YtSgruL129wRTpQEcHXIbZ+HahyB9SB/pvczo8My22leT0zPYYTNtbloVC6ODSO6iqV1SvMCTN4ZOvgxMUToMMY0QOXYvlr4I9guQChQBWQpzazKyPEFo7U91sN4EltrsRY7D/gt5ixskpuJlM= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 93ee044b-d49e-4ce0-3d80-08d59db178b3 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0902; x-ms-traffictypediagnostic: DM5PR2101MB0902: 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)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0902;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0902; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(396003)(39860400002)(39380400002)(346002)(199004)(189003)(5660300001)(478600001)(86612001)(3846002)(6116002)(106356001)(25786009)(6486002)(72206003)(10290500003)(8936002)(6436002)(76176011)(2616005)(6506007)(2900100001)(97736004)(26005)(486006)(10090500001)(36756003)(81166006)(8676002)(81156014)(59450400001)(102836004)(2906002)(99286004)(11346002)(476003)(3660700001)(66066001)(6512007)(575784001)(86362001)(53936002)(105586002)(186003)(5250100002)(14454004)(22452003)(6666003)(2501003)(446003)(7736002)(316002)(1076002)(110136005)(3280700002)(68736007)(54906003)(107886003)(4326008)(305945005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0902;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: AcPlCDohySkRK5+hDtM7ABOC9q/2qU6wPXsf8UReLvPhZONgU/ijIXOlH/26369iBysBNDdIUQ6GQlr7e5M9OgDphSWuvz46g/79+RLg8AmvxQ3hZIFGf13T45CelxfGUSQGLwgDcRmPV0KI+EIfjzro6MsZOoF7vjqWhisrugDDy3LmK1oHQudSSLZu3M8JQNTD+brIUqgpT40V4vQRKiZecMd6jyzmfR0NYUmDM8fhAlZYG8LXdarDKNS267gIDqBNr2fwGuNGsvJBU13+hhAQcVem9wxQU6FtA1+0pbOj9bt8ujqcJOn3Oq5LwIoZ/64ND8oSAPKvIq78sW+c8cNwOKVGYT+APYA1781rlMA0zgw5BHLs0Betqp3onAg3tbuS/HvUULPlfG4FGffaDctiIiifOp/Uo6nzLk9BRsA= 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: 93ee044b-d49e-4ce0-3d80-08d59db178b3 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:26:00.1911 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0902 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 1cd325765aaa..e30aeedd326e 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4142,9 +4142,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