Commit 1f8fe98e authored by Zhilong Liu's avatar Zhilong Liu Committed by Greg Kroah-Hartman

md.c:didn't unlock the mddev before return EINVAL in array_size_store


[ Upstream commit b670883b ]

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

Fixes: ab5a98b1 ("md-cluster: change array_sectors and update size are not supported")
Signed-off-by: default avatarZhilong Liu <zlliu@suse.com>
Reviewed-by: default avatarGuoqing Jiang <gqjiang@suse.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b42b97a5
......@@ -4826,8 +4826,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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment