Skip to content

Commit 086b170

Browse files
committed
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
2 parents da8f2e2 + 226291a commit 086b170

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

fs/ocfs2/cluster/heartbeat.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,8 +1964,10 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
19641964
if (reg == NULL)
19651965
return ERR_PTR(-ENOMEM);
19661966

1967-
if (strlen(name) > O2HB_MAX_REGION_NAME_LEN)
1968-
return ERR_PTR(-ENAMETOOLONG);
1967+
if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) {
1968+
ret = -ENAMETOOLONG;
1969+
goto free;
1970+
}
19691971

19701972
spin_lock(&o2hb_live_lock);
19711973
reg->hr_region_num = 0;
@@ -1974,7 +1976,8 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
19741976
O2NM_MAX_REGIONS);
19751977
if (reg->hr_region_num >= O2NM_MAX_REGIONS) {
19761978
spin_unlock(&o2hb_live_lock);
1977-
return ERR_PTR(-EFBIG);
1979+
ret = -EFBIG;
1980+
goto free;
19781981
}
19791982
set_bit(reg->hr_region_num, o2hb_region_bitmap);
19801983
}
@@ -1986,10 +1989,13 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
19861989
ret = o2hb_debug_region_init(reg, o2hb_debug_dir);
19871990
if (ret) {
19881991
config_item_put(&reg->hr_item);
1989-
return ERR_PTR(ret);
1992+
goto free;
19901993
}
19911994

19921995
return &reg->hr_item;
1996+
free:
1997+
kfree(reg);
1998+
return ERR_PTR(ret);
19931999
}
19942000

19952001
static void o2hb_heartbeat_group_drop_item(struct config_group *group,

fs/ocfs2/dcache.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ static void ocfs2_dentry_iput(struct dentry *dentry, struct inode *inode)
476476

477477
out:
478478
iput(inode);
479-
ocfs2_dentry_attach_gen(dentry);
480479
}
481480

482481
/*

fs/ocfs2/dlm/dlmdomain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ static int dlm_match_regions(struct dlm_ctxt *dlm,
959959
r += O2HB_MAX_REGION_NAME_LEN;
960960
}
961961

962-
local = kmalloc(sizeof(qr->qr_regions), GFP_KERNEL);
962+
local = kmalloc(sizeof(qr->qr_regions), GFP_ATOMIC);
963963
if (!local) {
964964
status = -ENOMEM;
965965
goto bail;

fs/ocfs2/ocfs2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ struct ocfs2_lock_res {
159159
char l_name[OCFS2_LOCK_ID_MAX_LEN];
160160
unsigned int l_ro_holders;
161161
unsigned int l_ex_holders;
162-
char l_level;
163-
char l_requested;
164-
char l_blocking;
162+
signed char l_level;
163+
signed char l_requested;
164+
signed char l_blocking;
165165

166166
/* Data packed - type enum ocfs2_lock_type */
167167
unsigned char l_type;

fs/ocfs2/stack_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static struct ocfs2_live_connection *ocfs2_connection_find(const char *name)
190190
return c;
191191
}
192192

193-
return c;
193+
return NULL;
194194
}
195195

196196
/*

0 commit comments

Comments
 (0)