summaryrefslogtreecommitdiffstats
path: root/drivers/md/md-cluster.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2016-09-06 12:35:56 -0400
committerTejun Heo <tj@kernel.org>2016-09-06 12:35:56 -0400
commit2536524a91fe5c5a9fddd282fd4e79ee0976aefe (patch)
tree30eb5b4cd6d9ed4fda69526537d4fac454cbc5e6 /drivers/md/md-cluster.c
parent7d36dd00ab8d57134cce86ad4febc2f5bbdf3e72 (diff)
parentbc4dee5aa72723632a1f83fd0d3720066c93b433 (diff)
downloadlinux-2536524a91fe5c5a9fddd282fd4e79ee0976aefe.tar.gz
linux-2536524a91fe5c5a9fddd282fd4e79ee0976aefe.tar.bz2
linux-2536524a91fe5c5a9fddd282fd4e79ee0976aefe.zip
Merge branch 'master' into for-4.9
Diffstat (limited to 'drivers/md/md-cluster.c')
-rw-r--r--drivers/md/md-cluster.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index 41573f1f626f..34a840d9df76 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -834,8 +834,10 @@ static int join(struct mddev *mddev, int nodes)
goto err;
}
cinfo->ack_lockres = lockres_init(mddev, "ack", ack_bast, 0);
- if (!cinfo->ack_lockres)
+ if (!cinfo->ack_lockres) {
+ ret = -ENOMEM;
goto err;
+ }
/* get sync CR lock on ACK. */
if (dlm_lock_sync(cinfo->ack_lockres, DLM_LOCK_CR))
pr_err("md-cluster: failed to get a sync CR lock on ACK!(%d)\n",
@@ -849,8 +851,10 @@ static int join(struct mddev *mddev, int nodes)
pr_info("md-cluster: Joined cluster %s slot %d\n", str, cinfo->slot_number);
snprintf(str, 64, "bitmap%04d", cinfo->slot_number - 1);
cinfo->bitmap_lockres = lockres_init(mddev, str, NULL, 1);
- if (!cinfo->bitmap_lockres)
+ if (!cinfo->bitmap_lockres) {
+ ret = -ENOMEM;
goto err;
+ }
if (dlm_lock_sync(cinfo->bitmap_lockres, DLM_LOCK_PW)) {
pr_err("Failed to get bitmap lock\n");
ret = -EINVAL;
@@ -858,8 +862,10 @@ static int join(struct mddev *mddev, int nodes)
}
cinfo->resync_lockres = lockres_init(mddev, "resync", NULL, 0);
- if (!cinfo->resync_lockres)
+ if (!cinfo->resync_lockres) {
+ ret = -ENOMEM;
goto err;
+ }
return 0;
err: