Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222969
b: refs/heads/master
c: 1cf257f
h: refs/heads/master
i:
  222967: 6e7c624
v: v3
  • Loading branch information
Jiri Slaby authored and Joel Becker committed Nov 18, 2010
1 parent 9692a91 commit 910c25b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a48a982a6bd3896274dd643397c72da9258411e2
refs/heads/master: 1cf257f511918ba5b2eabd64d9acd40f1d7866ef
14 changes: 10 additions & 4 deletions trunk/fs/ocfs2/cluster/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1964,8 +1964,10 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
if (reg == NULL)
return ERR_PTR(-ENOMEM);

if (strlen(name) > O2HB_MAX_REGION_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG);
if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) {
ret = -ENAMETOOLONG;
goto free;
}

spin_lock(&o2hb_live_lock);
reg->hr_region_num = 0;
Expand All @@ -1974,7 +1976,8 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
O2NM_MAX_REGIONS);
if (reg->hr_region_num >= O2NM_MAX_REGIONS) {
spin_unlock(&o2hb_live_lock);
return ERR_PTR(-EFBIG);
ret = -EFBIG;
goto free;
}
set_bit(reg->hr_region_num, o2hb_region_bitmap);
}
Expand All @@ -1986,10 +1989,13 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
ret = o2hb_debug_region_init(reg, o2hb_debug_dir);
if (ret) {
config_item_put(&reg->hr_item);
return ERR_PTR(ret);
goto free;
}

return &reg->hr_item;
free:
kfree(reg);
return ERR_PTR(ret);
}

static void o2hb_heartbeat_group_drop_item(struct config_group *group,
Expand Down

0 comments on commit 910c25b

Please sign in to comment.