Received: by 10.213.65.68 with SMTP id h4csp1760228imn; Mon, 19 Mar 2018 12:30:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELsHsDDfy6riXRKLeLDUDtpAMdgikYZ7XSdUFJ4OIebjFmIpIOiZKNt9uCEuLS+BycGJNdRy X-Received: by 10.99.101.198 with SMTP id z189mr9933881pgb.97.1521487807012; Mon, 19 Mar 2018 12:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521487806; cv=none; d=google.com; s=arc-20160816; b=iSWzFPU7QLFBphzhb2Pt6gRbRrpaeWRHJBpkjX5jQyxLaFc6d5wl0J+t7jqSi05Wfn 6YzyBd4EnfZKam9EeDM7nDGPmNxOvKGRsBLFJbFBdrrxyyazrMeO65PnKXnoMNzb9w19 0nLqChLqveQEjqoKuyslueAgMhEKUxG9Q3eRu+OP5nMmDlL9Rob25Tn3CnXQ541+MGhN l/0E7aSaStuq3sRcXo+kAgqi75mtKrY9IvN8WD+NRT1+1mSDXkM8TawHruuy9ZvtPZTa SlQZgk1pXOutjP09lgxEfvSa4A8ZlD9XlyMZYhTHgBmLYtVgjYJNp8+Kbs9vgmoSSyyw OMyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=zUHO7N72lFwgUQ1fAVmphsAwnTrEQDwawoG9hntiMdo=; b=wi6forLhXvky0IvNY4grpCI3QpqL5sRh1/01RPIReSgmXDtfPfV5wUYJpApcAgBKN2 AeAARAtjMREAGk9OkwrWDdyECahTHI2A1gH/ty0IDtm9n5llqmuVI+MKGwaT1heVx6wl kMJTG+11nV37hfeXOx3xxV3T2delmnk5OT8R7975/kXrWVAixXZIidKwfM82R4f+u5uX dehJla8yYArHFHiwBXgvpvWXEPh2io+HQzkE+GjVkZEKIkZYs+33vDjWC6Kag46BKsjE o3tGsEIzcnt2qT+R2mdfuu6mkBB2WJSnlDx8ERwSLK1vTiQY8RtvwK1YWj8ZzjVChqi5 q+PA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m16si409493pgn.416.2018.03.19.12.29.52; Mon, 19 Mar 2018 12:30:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936043AbeCST2R (ORCPT + 99 others); Mon, 19 Mar 2018 15:28:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49754 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969592AbeCSSYG (ORCPT ); Mon, 19 Mar 2018 14:24:06 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2722CE8E; Mon, 19 Mar 2018 18:24:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhilong Liu , Guoqing Jiang , Shaohua Li , Sasha Levin Subject: [PATCH 4.9 137/241] md.c:didnt unlock the mddev before return EINVAL in array_size_store Date: Mon, 19 Mar 2018 19:06:42 +0100 Message-Id: <20180319180756.864287271@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/md/md.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4826,8 +4826,10 @@ array_size_store(struct mddev *mddev, co return err; /* cluster raid doesn't support change array_sectors */ - if (mddev_is_clustered(mddev)) + if (mddev_is_clustered(mddev)) { + mddev_unlock(mddev); return -EINVAL; + } if (strncmp(buf, "default", 7) == 0) { if (mddev->pers)