Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/jlbec/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
  ocfs2_connection_find() returns pointer to bad structure
  ocfs2: char is not always signed
  Ocfs2: Stop tracking a negative dentry after dentry_iput().
  ocfs2: fix memory leak
  fs/ocfs2/dlm: Use GFP_ATOMIC under spin_lock
  • Loading branch information
Linus Torvalds committed Dec 7, 2010
2 parents da8f2e2 + 226291a commit 086b170
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
14 changes: 10 additions & 4 deletions 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
1 change: 0 additions & 1 deletion fs/ocfs2/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ static void ocfs2_dentry_iput(struct dentry *dentry, struct inode *inode)

out:
iput(inode);
ocfs2_dentry_attach_gen(dentry);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/dlm/dlmdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ static int dlm_match_regions(struct dlm_ctxt *dlm,
r += O2HB_MAX_REGION_NAME_LEN;
}

local = kmalloc(sizeof(qr->qr_regions), GFP_KERNEL);
local = kmalloc(sizeof(qr->qr_regions), GFP_ATOMIC);
if (!local) {
status = -ENOMEM;
goto bail;
Expand Down
6 changes: 3 additions & 3 deletions fs/ocfs2/ocfs2.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ struct ocfs2_lock_res {
char l_name[OCFS2_LOCK_ID_MAX_LEN];
unsigned int l_ro_holders;
unsigned int l_ex_holders;
char l_level;
char l_requested;
char l_blocking;
signed char l_level;
signed char l_requested;
signed char l_blocking;

/* Data packed - type enum ocfs2_lock_type */
unsigned char l_type;
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/stack_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static struct ocfs2_live_connection *ocfs2_connection_find(const char *name)
return c;
}

return c;
return NULL;
}

/*
Expand Down

0 comments on commit 086b170

Please sign in to comment.