Received: by 10.223.185.116 with SMTP id b49csp1104288wrg; Sat, 3 Mar 2018 15:41:01 -0800 (PST) X-Google-Smtp-Source: AG47ELuOYB7HWhGFGgrJgRe7i8u9L0mG9kIqMur687STyVhWU+dJ0IkeVjNo42iUDKc3mdKIHkE5 X-Received: by 2002:a17:902:7142:: with SMTP id u2-v6mr9012138plm.257.1520120461306; Sat, 03 Mar 2018 15:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520120461; cv=none; d=google.com; s=arc-20160816; b=CNCPxhImxLB+6XXhZ2VxeN5qc3Ax98EemyaVWyYcqfY/BhNvyovYImB+D0RvaJ4LnI AF+AKUP6xUandyBZ1metViOlQFanqjbZlN8GO1ByLaWIUSE1Tnv5KrBLkutnZRItkrJR UtNWVQ4oBgsYTr7r7/2geHk9PP6Fk4H3WCk29lKL/IMJviPCe5lAr8qKW8VAYifzNRo5 adyUpmbw+1phesPMG/SKX2SZL4LgZihIgEGgbeq9MyAiqo3VSlA1AhNAkNtRuaHO0Y20 8Bk9TfU8x9y7B1VdZsuskeOyunA3VCn8uP2XtkizhZJAswwl8qkBzwrEH3TO9WAtPvTZ P/+Q== 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 :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=vweaBAJhwwX+CCWCU1QuY2AVyaa82eEW82aKvC+rdqA=; b=WDX7vPXKB1LdTBa710aIBNNElhFradli2A+P4GNSyaLi+wE11RSAOwwhf1KTyrvCZf /kIhyu7uOO4yQs/DZ/zBdYxmFI57QHYq0vMcBHUytWR2rS07/7WJxQtXqRpNn1Ukzhqt lKhOR34SGbsQYpI9AoHdrGpa2EBX3+0CLb/VONPtE2taZki7WqwLIrJ93f/6U9CKbrj9 XWqkwwwW6cWCiW7Za2yg7GFesrUzAcfG6uJvr9bQtz0KqxBiZ2UOMxo2MPhSnbnNIKwJ cZroxeL+/mVv36m5ogPM7fwyJ97h9Gb+9kfbceLF+LU8HVb1+485wpbj9OJYEgzy+AeH bQrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=O8zfofFi; 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 p27-v6si6945668pli.328.2018.03.03.15.40.47; Sat, 03 Mar 2018 15:41:01 -0800 (PST) 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=O8zfofFi; 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 S934508AbeCCXkP (ORCPT + 99 others); Sat, 3 Mar 2018 18:40:15 -0500 Received: from mail-sn1nam02on0094.outbound.protection.outlook.com ([104.47.36.94]:45030 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934308AbeCCWfE (ORCPT ); Sat, 3 Mar 2018 17:35:04 -0500 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=vweaBAJhwwX+CCWCU1QuY2AVyaa82eEW82aKvC+rdqA=; b=O8zfofFivRGyfGbVowobrwl6E6wBWhPBwUfdm7bWy7GvfyXX7b84AQR3NFJl/v7UPvBOn95Mj7Sz8G723R4oUdshI/8G7xOnSo+AtGEgj/N/iYpRbutCJBvU9He9n/+ATSS9u+LeurkWs9tYjk57DOLdRmXRLsmTfAV/he5xjtU= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB0924.namprd21.prod.outlook.com (52.132.152.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Sat, 3 Mar 2018 22:34:58 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:34:58 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Zhilong Liu , Shaohua Li , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 144/219] md.c:didn't unlock the mddev before return EINVAL in array_size_store Thread-Topic: [PATCH AUTOSEL for 4.9 144/219] md.c:didn't unlock the mddev before return EINVAL in array_size_store Thread-Index: AQHTsz8SJp8Hgc65FE2CDnRol0iI1w== Date: Sat, 3 Mar 2018 22:29:20 +0000 Message-ID: <20180303222716.26640-144-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-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;MW2PR2101MB0924;6:tXxC1TKs+rltf0H8LYCZhsCqbDBTq0Hx5L5J2iYyDVsPvW7vypRjuWlg58tMLytcr0x+vDiG9gZPUAjlr4Kvs/8PyvMR3vlJ26oeOXotsx6U9kUZtH5dYrZPVcrxvR/RXmK2Ri9MHyYQau8UWymMowuyhs0RpAPpx3qFQjrHGaSjmmqpiZeJrFMaUm+VCJ3MNIg7mvjumHK5MegzrLVLgMNFy1g+BTwUeZoQM9msBOn4o4DoMK592/BBC7UMno5EDBHA/FTrE4hIN0mL+fe76900QyBp3d3qEGtacUl27tGAgYRUgCyJlUvPFFEM2Z0w0VzDf/fIxTNUZUM4huZ6h/jNa5qZtDFDDITR9w+bTh4=;5:4C8ytdsgqjfPRjwxfAb3vmESEdZOZDGTRHmNIVLMqi0jag1rCtWL66aiCVdgC/T0RtvRYYwfKTX0s9bkPQeAj5m5oxw9a8HDuJCRBe5YrquvPMzoi0BdQM7mNvp4IeLEXWGRc7yyE2d7TDAQi0qAwCOysynfXcuSdpS4WOITD2U=;24:ZXNtu4zGAjoGjlrGBil2KWkG1rA7IR7w6t59KM8bgpO18AemgI0BRK+FwfysdWvGjIFiBPjvdkOAUfcsAjDFDj9+Hd+xeCJRMwaQizIilFc=;7:3WPsCVi0yhkNATnQ5vGnUGxa7k2C3uueiU2bUc5JBYCjNxj28Hqm7++s6pmNNMm0gKh90e7E/fjh9GDqXWL4sS2ugSQXUcgr5Tv4dIwxLYzxbqu06hRZsKKUw6RoZ0pfnC6qsFv7l2QRlQLXGiN/bUH2BuidjLYJ/UiWuHd3HN+KWYo5d12alePEogpeE28xybTIivE5gim9PH5yJXhcb6GeSL6nvoUxArh9PeLhgN6myZvJqjb87HSn7F3AOMMg x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 19b008ac-9381-4179-ffbf-08d58156fec3 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:MW2PR2101MB0924; x-ms-traffictypediagnostic: MW2PR2101MB0924: 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)(67672495146484); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB0924;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB0924; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(39860400002)(396003)(366004)(39380400002)(189003)(199004)(102836004)(2950100002)(10090500001)(6666003)(316002)(26005)(186003)(25786009)(2900100001)(2906002)(54906003)(22452003)(110136005)(97736004)(6506007)(59450400001)(7736002)(4326008)(305945005)(5250100002)(86362001)(2501003)(99286004)(68736007)(72206003)(53936002)(6436002)(6116002)(3846002)(5660300001)(66066001)(1076002)(76176011)(14454004)(36756003)(3660700001)(6486002)(86612001)(81156014)(8676002)(81166006)(10290500003)(6512007)(8936002)(3280700002)(478600001)(107886003)(106356001)(105586002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB0924;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) 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: 19b008ac-9381-4179-ffbf-08d58156fec3 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:29:20.0413 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB0924 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhilong Liu [ Upstream commit b670883bb9e55ba63a278d83e034faefc01ce2cf ] md.c: it needs to release the mddev lock before the array_size_store() returns. Fixes: ab5a98b132fd ("md-cluster: change array_sectors and update size are = not supported") Signed-off-by: Zhilong Liu Reviewed-by: Guoqing Jiang Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin --- drivers/md/md.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 8ebf1b97e1d2..564da422c179 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4826,8 +4826,10 @@ array_size_store(struct mddev *mddev, const char *bu= f, size_t len) return err; =20 /* cluster raid doesn't support change array_sectors */ - if (mddev_is_clustered(mddev)) + if (mddev_is_clustered(mddev)) { + mddev_unlock(mddev); return -EINVAL; + } =20 if (strncmp(buf, "default", 7) =3D=3D 0) { if (mddev->pers) --=20 2.14.1