Received: by 10.213.65.68 with SMTP id h4csp2126287imn; Sun, 8 Apr 2018 20:22:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx499TA6bZmVrBpaHcAb+dVhN28sbIWd5x2e39PAi/jMSTUNDEXxTLNkOHNLxqCbu9Qqqq2ys X-Received: by 2002:a17:902:f24:: with SMTP id 33-v6mr36885103ply.242.1523244140173; Sun, 08 Apr 2018 20:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523244140; cv=none; d=google.com; s=arc-20160816; b=sO4DlnG8HrJZA7K4bSf+4hw0ZxIAyX3Fe7TPneeSgeLt1AV7vbEEEagCaPN9XKIhzE QhclVtwxup9gHA56WqGvjDPRktIYIaYMIhRG7L6tVdC3i73DVlkiJBplQY9p+gUz/N11 HswxRFfMGFjq0Qk0mEfyOnmEGdIEXFWf1TkV7tLL2OCUXTls1hQRU7z72COHioGpp/KT rFzQ9DRNIygDMdb3NxMfswcyj8YdfYd+2ztiwdBzOZEILL2o7hAhSQUVIaDCcUD+eMPH Hfed5Wiyvxb6U63ZpzTR3EJueuxwKVKmcbGTqEltHsC12SaTC7VkmWP8v3JepoPbBqgM yjOg== 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=nIzuqi4tgtSdMOL+Zm7Ww4nxJychdwpl9BSS0htazYY=; b=L0taGPXvIqpvwvpPFg2EbqouwBsJ5lZCGjwJuEwLQxtvA5ce90n692JbyW84LvSO5N czs5TNQB3v3/apQXx0eBUrOkDrmZ+OtIcbU1X6rRxtWybFzUT0gHIwu4ogCmqYyoawsn +Crh8dTaP1dDhoA13sUZatPzg1KTi00ZtmxsIt0txffHkmUFCGggkMOXX/MYkVjeyKYJ m50yMDpTVBEydpHxCg2wuCjqJ8NYL5VyUnk/xx4NzsWKH0Hcd2OaJCeuiVC+bwYnFS4Z /TP4B7uWws/uYe5yq+xxG8YCFOmCz8zONL5xU0pord1X9Gtqvue3rYbnH1M45ue2wcNS /cEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=kwvLrHRL; 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 y14-v6si3436061plr.314.2018.04.08.20.21.43; Sun, 08 Apr 2018 20:22:20 -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=kwvLrHRL; 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 S1752850AbeDIDSr (ORCPT + 99 others); Sun, 8 Apr 2018 23:18:47 -0400 Received: from mail-bn3nam01on0095.outbound.protection.outlook.com ([104.47.33.95]:56127 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753918AbeDIAXc (ORCPT ); Sun, 8 Apr 2018 20:23:32 -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=nIzuqi4tgtSdMOL+Zm7Ww4nxJychdwpl9BSS0htazYY=; b=kwvLrHRLdEo5NLkc9mLmZydDTffAss4YlWl7Fo1FhE0aeCl+kmRBFXNvs8sTbZl3QFLGjkAqPyCTrsi7X7pA4llMcAhBOM4qBoATA5LYc/VNW7wzzBtunLPAcokH4ptiAbdGGNnuK3jsGxaPeN0XPDPLbQblott2VwbZY9zZPdA= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1014.namprd21.prod.outlook.com (52.132.133.36) 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:23: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:23: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.14 054/161] btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP Thread-Topic: [PATCH AUTOSEL for 4.14 054/161] btrfs: fail mount when sb flag is not in BTRFS_SUPER_FLAG_SUPP Thread-Index: AQHTz5iRI1Ee4Gxi7UiBbb/Rw9TUBA== Date: Mon, 9 Apr 2018 00:20:30 +0000 Message-ID: <20180409001936.162706-54-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB1014;7:8ypvQFrizc6Otu0YWjbOyL4EuRf6nY54Ipt2oKi4cBCuf3tvvaZEILhHEAOccRMzxfM0fxUcC2cdut38P2k/hQuXvrCsI2rEf1dSc0K6Ato5xmSZXGsv0jzjwFASAGM5onvrTfyJm4I9OZwcpFmPv8rMUgO7UdY3MtrnV8Y/mzCSULdUWAjRsOcUJLlp7QPUsnGsQKds9XI7Y9aoFaZ2ZfJT8JaLI+sNtTVId4R8LMryE8YJUZozg2WCiThPaaxe;20:8pD2VwATDDHzxsDKB5NG7/QcgdytsbJ68Lt6+ckYQDDMqEFgaHDB6nNjpPhlxhtVjgiOvyZ8emZ4vL+6QOll4BY44TgD6jAP5JwOVjQqbytoLP4fk+ZEb0xDd5ssXZ6IXBAVE3mr/z4eyzXypwjW2CUCuhvLsdQQ+iogMwEa04Q= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: da98eabb-da1e-4e33-3da5-08d59db01eb1 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1014; x-ms-traffictypediagnostic: DM5PR2101MB1014: 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)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1014;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1014; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(39860400002)(39380400002)(396003)(376002)(189003)(199004)(81166006)(81156014)(478600001)(6436002)(72206003)(575784001)(8936002)(10290500003)(106356001)(99286004)(86362001)(2616005)(7736002)(2501003)(6666003)(446003)(476003)(8676002)(11346002)(105586002)(305945005)(5250100002)(6512007)(53936002)(68736007)(107886003)(66066001)(86612001)(2906002)(14454004)(186003)(22452003)(25786009)(4326008)(2900100001)(486006)(36756003)(6486002)(3660700001)(59450400001)(54906003)(26005)(3280700002)(110136005)(1076002)(10090500001)(76176011)(6506007)(97736004)(316002)(3846002)(6116002)(102836004)(5660300001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1014;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Ry6fGpHypfalGBrMMzGwqsybKR0WuKdEByGXiRyw4ye8p59vduK+uosR0rQrLG5C3YCzcH6f0+kfITB48RTekAJa/UEatyAiQyuMzwJTQlVgLWd/S1ZtLn4ACmpPx8bdwV7v9E6f6oHVB/k7HONE8qa45LTuD0/hAzZqMi0V0wikftXDIfye/6mmgNCgckhezkq6BzOeALmTxmWS8vjkJdeWLaTFHu/vQ/DUqyZEgXV9dw4GKye4YZ90zrE+7gdNrIeVwdBmtFv3WJSqsR6LMkLSpXjTC77drQ1liqh3oT7Rv9MVC50g6+evdzJo8EfA8gsU8YL5ypdbNzZloCl/I4CTME9uamJn8FNwvttrqxrzp3KYdIqlqEOQsuQa4z0dHAV4EBqamNS7YPpFiKj+QrP5PnMfWPQlPuksv4v2Wxc= 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: da98eabb-da1e-4e33-3da5-08d59db01eb1 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:20:30.4255 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1014 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 167ce43cabe8..79f0f282a0ef 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4063,9 +4063,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