linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhilong Liu <zlliu@suse.com>
To: shli@fb.com
Cc: linux-raid@vger.kernel.org, Zhilong Liu <zlliu@suse.com>
Subject: [PATCH] md.c:didn't unlock the mddev before return EINVAL in array_size_store
Date: Mon, 10 Apr 2017 14:15:55 +0800	[thread overview]
Message-ID: <1491804955-7548-1-git-send-email-zlliu@suse.com> (raw)

md.c: it needs to release the mddev lock before
the array_size_store() returns.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
---
 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 f6ae1d6..5327236 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4843,8 +4843,10 @@ array_size_store(struct mddev *mddev, const char *buf, size_t len)
 		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)
-- 
2.6.6


             reply	other threads:[~2017-04-10  6:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10  6:15 Zhilong Liu [this message]
2017-04-10  7:23 ` [PATCH] md.c:didn't unlock the mddev before return EINVAL in array_size_store Guoqing Jiang
2017-04-10 17:49 ` Shaohua Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491804955-7548-1-git-send-email-zlliu@suse.com \
    --to=zlliu@suse.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).