From: Zhilong Liu Date: Mon, 10 Apr 2017 06:15:55 +0000 (+0800) Subject: md.c:didn't unlock the mddev before return EINVAL in array_size_store X-Git-Tag: v4.12-rc1~121^2^2~25 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b670883bb9e55ba63a278d83e034faefc01ce2cf;p=karo-tx-linux.git 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 Reviewed-by: Guoqing Jiang Signed-off-by: Shaohua Li --- diff --git a/drivers/md/md.c b/drivers/md/md.c index a612b9f83069..5022be183390 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4950,8 +4950,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)