浏览代码

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

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 <zlliu@suse.com>
Reviewed-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Zhilong Liu 8 年之前
父节点
当前提交
b670883bb9
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/md/md.c

+ 3 - 1
drivers/md/md.c

@@ -4950,8 +4950,10 @@ array_size_store(struct mddev *mddev, const char *buf, size_t len)
 		return err;
 		return err;
 
 
 	/* cluster raid doesn't support change array_sectors */
 	/* cluster raid doesn't support change array_sectors */
-	if (mddev_is_clustered(mddev))
+	if (mddev_is_clustered(mddev)) {
+		mddev_unlock(mddev);
 		return -EINVAL;
 		return -EINVAL;
+	}
 
 
 	if (strncmp(buf, "default", 7) == 0) {
 	if (strncmp(buf, "default", 7) == 0) {
 		if (mddev->pers)
 		if (mddev->pers)