aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r--fs/ocfs2/cluster/heartbeat.c14
-rw-r--r--fs/ocfs2/cluster/masklog.c3
-rw-r--r--fs/ocfs2/cluster/masklog.h15
3 files changed, 20 insertions, 12 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 892e2de49903..9e3d45bcb5fd 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1963,8 +1963,10 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
1963 if (reg == NULL) 1963 if (reg == NULL)
1964 return ERR_PTR(-ENOMEM); 1964 return ERR_PTR(-ENOMEM);
1965 1965
1966 if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) 1966 if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) {
1967 return ERR_PTR(-ENAMETOOLONG); 1967 ret = -ENAMETOOLONG;
1968 goto free;
1969 }
1968 1970
1969 spin_lock(&o2hb_live_lock); 1971 spin_lock(&o2hb_live_lock);
1970 reg->hr_region_num = 0; 1972 reg->hr_region_num = 0;
@@ -1973,7 +1975,8 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
1973 O2NM_MAX_REGIONS); 1975 O2NM_MAX_REGIONS);
1974 if (reg->hr_region_num >= O2NM_MAX_REGIONS) { 1976 if (reg->hr_region_num >= O2NM_MAX_REGIONS) {
1975 spin_unlock(&o2hb_live_lock); 1977 spin_unlock(&o2hb_live_lock);
1976 return ERR_PTR(-EFBIG); 1978 ret = -EFBIG;
1979 goto free;
1977 } 1980 }
1978 set_bit(reg->hr_region_num, o2hb_region_bitmap); 1981 set_bit(reg->hr_region_num, o2hb_region_bitmap);
1979 } 1982 }
@@ -1985,10 +1988,13 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
1985 ret = o2hb_debug_region_init(reg, o2hb_debug_dir); 1988 ret = o2hb_debug_region_init(reg, o2hb_debug_dir);
1986 if (ret) { 1989 if (ret) {
1987 config_item_put(&reg->hr_item); 1990 config_item_put(&reg->hr_item);
1988 return ERR_PTR(ret); 1991 goto free;
1989 } 1992 }
1990 1993
1991 return &reg->hr_item; 1994 return &reg->hr_item;
1995free:
1996 kfree(reg);
1997 return ERR_PTR(ret);
1992} 1998}
1993 1999
1994static void o2hb_heartbeat_group_drop_item(struct config_group *group, 2000static void o2hb_heartbeat_group_drop_item(struct config_group *group,
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index c7fba396392d..6c61771469af 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -113,10 +113,11 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
113 define_mask(QUOTA), 113 define_mask(QUOTA),
114 define_mask(REFCOUNT), 114 define_mask(REFCOUNT),
115 define_mask(BASTS), 115 define_mask(BASTS),
116 define_mask(RESERVATIONS),
117 define_mask(CLUSTER),
116 define_mask(ERROR), 118 define_mask(ERROR),
117 define_mask(NOTICE), 119 define_mask(NOTICE),
118 define_mask(KTHREAD), 120 define_mask(KTHREAD),
119 define_mask(RESERVATIONS),
120}; 121};
121 122
122static struct attribute *mlog_attr_ptrs[MLOG_MAX_BITS] = {NULL, }; 123static struct attribute *mlog_attr_ptrs[MLOG_MAX_BITS] = {NULL, };
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h
index ea2ed9f56c94..34d6544357d9 100644
--- a/fs/ocfs2/cluster/masklog.h
+++ b/fs/ocfs2/cluster/masklog.h
@@ -81,7 +81,7 @@
81#include <linux/sched.h> 81#include <linux/sched.h>
82 82
83/* bits that are frequently given and infrequently matched in the low word */ 83/* bits that are frequently given and infrequently matched in the low word */
84/* NOTE: If you add a flag, you need to also update mlog.c! */ 84/* NOTE: If you add a flag, you need to also update masklog.c! */
85#define ML_ENTRY 0x0000000000000001ULL /* func call entry */ 85#define ML_ENTRY 0x0000000000000001ULL /* func call entry */
86#define ML_EXIT 0x0000000000000002ULL /* func call exit */ 86#define ML_EXIT 0x0000000000000002ULL /* func call exit */
87#define ML_TCP 0x0000000000000004ULL /* net cluster/tcp.c */ 87#define ML_TCP 0x0000000000000004ULL /* net cluster/tcp.c */
@@ -114,13 +114,14 @@
114#define ML_XATTR 0x0000000020000000ULL /* ocfs2 extended attributes */ 114#define ML_XATTR 0x0000000020000000ULL /* ocfs2 extended attributes */
115#define ML_QUOTA 0x0000000040000000ULL /* ocfs2 quota operations */ 115#define ML_QUOTA 0x0000000040000000ULL /* ocfs2 quota operations */
116#define ML_REFCOUNT 0x0000000080000000ULL /* refcount tree operations */ 116#define ML_REFCOUNT 0x0000000080000000ULL /* refcount tree operations */
117#define ML_BASTS 0x0000001000000000ULL /* dlmglue asts and basts */ 117#define ML_BASTS 0x0000000100000000ULL /* dlmglue asts and basts */
118#define ML_RESERVATIONS 0x0000000200000000ULL /* ocfs2 alloc reservations */
119#define ML_CLUSTER 0x0000000400000000ULL /* cluster stack */
120
118/* bits that are infrequently given and frequently matched in the high word */ 121/* bits that are infrequently given and frequently matched in the high word */
119#define ML_ERROR 0x0000000100000000ULL /* sent to KERN_ERR */ 122#define ML_ERROR 0x1000000000000000ULL /* sent to KERN_ERR */
120#define ML_NOTICE 0x0000000200000000ULL /* setn to KERN_NOTICE */ 123#define ML_NOTICE 0x2000000000000000ULL /* setn to KERN_NOTICE */
121#define ML_KTHREAD 0x0000000400000000ULL /* kernel thread activity */ 124#define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */
122#define ML_RESERVATIONS 0x0000000800000000ULL /* ocfs2 alloc reservations */
123#define ML_CLUSTER 0x0000001000000000ULL /* cluster stack */
124 125
125#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE) 126#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE)
126#define MLOG_INITIAL_NOT_MASK (ML_ENTRY|ML_EXIT) 127#define MLOG_INITIAL_NOT_MASK (ML_ENTRY|ML_EXIT)