Commit 086b1704 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
parents da8f2e24 226291aa
...@@ -1964,8 +1964,10 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g ...@@ -1964,8 +1964,10 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
if (reg == NULL) if (reg == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) {
return ERR_PTR(-ENAMETOOLONG); ret = -ENAMETOOLONG;
goto free;
}
spin_lock(&o2hb_live_lock); spin_lock(&o2hb_live_lock);
reg->hr_region_num = 0; reg->hr_region_num = 0;
...@@ -1974,7 +1976,8 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g ...@@ -1974,7 +1976,8 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
O2NM_MAX_REGIONS); O2NM_MAX_REGIONS);
if (reg->hr_region_num >= O2NM_MAX_REGIONS) { if (reg->hr_region_num >= O2NM_MAX_REGIONS) {
spin_unlock(&o2hb_live_lock); spin_unlock(&o2hb_live_lock);
return ERR_PTR(-EFBIG); ret = -EFBIG;
goto free;
} }
set_bit(reg->hr_region_num, o2hb_region_bitmap); set_bit(reg->hr_region_num, o2hb_region_bitmap);
} }
...@@ -1986,10 +1989,13 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g ...@@ -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); ret = o2hb_debug_region_init(reg, o2hb_debug_dir);
if (ret) { if (ret) {
config_item_put(&reg->hr_item); config_item_put(&reg->hr_item);
return ERR_PTR(ret); goto free;
} }
return &reg->hr_item; return &reg->hr_item;
free:
kfree(reg);
return ERR_PTR(ret);
} }
static void o2hb_heartbeat_group_drop_item(struct config_group *group, static void o2hb_heartbeat_group_drop_item(struct config_group *group,
......
...@@ -476,7 +476,6 @@ static void ocfs2_dentry_iput(struct dentry *dentry, struct inode *inode) ...@@ -476,7 +476,6 @@ static void ocfs2_dentry_iput(struct dentry *dentry, struct inode *inode)
out: out:
iput(inode); iput(inode);
ocfs2_dentry_attach_gen(dentry);
} }
/* /*
......
...@@ -959,7 +959,7 @@ static int dlm_match_regions(struct dlm_ctxt *dlm, ...@@ -959,7 +959,7 @@ static int dlm_match_regions(struct dlm_ctxt *dlm,
r += O2HB_MAX_REGION_NAME_LEN; r += O2HB_MAX_REGION_NAME_LEN;
} }
local = kmalloc(sizeof(qr->qr_regions), GFP_KERNEL); local = kmalloc(sizeof(qr->qr_regions), GFP_ATOMIC);
if (!local) { if (!local) {
status = -ENOMEM; status = -ENOMEM;
goto bail; goto bail;
......
...@@ -159,9 +159,9 @@ struct ocfs2_lock_res { ...@@ -159,9 +159,9 @@ struct ocfs2_lock_res {
char l_name[OCFS2_LOCK_ID_MAX_LEN]; char l_name[OCFS2_LOCK_ID_MAX_LEN];
unsigned int l_ro_holders; unsigned int l_ro_holders;
unsigned int l_ex_holders; unsigned int l_ex_holders;
char l_level; signed char l_level;
char l_requested; signed char l_requested;
char l_blocking; signed char l_blocking;
/* Data packed - type enum ocfs2_lock_type */ /* Data packed - type enum ocfs2_lock_type */
unsigned char l_type; unsigned char l_type;
......
...@@ -190,7 +190,7 @@ static struct ocfs2_live_connection *ocfs2_connection_find(const char *name) ...@@ -190,7 +190,7 @@ static struct ocfs2_live_connection *ocfs2_connection_find(const char *name)
return c; return c;
} }
return c; return NULL;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment