Skip to content

Commit a634644

Browse files
Gang Hetorvalds
authored andcommitted
ocfs2: remove ocfs2_is_o2cb_active()
Remove ocfs2_is_o2cb_active(). We have similar functions to identify which cluster stack is being used via osb->osb_cluster_stack. Secondly, the current implementation of ocfs2_is_o2cb_active() is not totally safe. Based on the design of stackglue, we need to get ocfs2_stack_lock before using ocfs2_stack related data structures, and that active_stack pointer can be NULL in the case of mount failure. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Gang He <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Reviewed-by: Eric Ren <[email protected]> Acked-by: Changwei Ge <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ac5b2c1 commit a634644

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

fs/ocfs2/dlmglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3603,7 +3603,7 @@ static int ocfs2_downconvert_lock(struct ocfs2_super *osb,
36033603
* we can recover correctly from node failure. Otherwise, we may get
36043604
* invalid LVB in LKB, but without DLM_SBF_VALNOTVALID being set.
36053605
*/
3606-
if (!ocfs2_is_o2cb_active() &&
3606+
if (ocfs2_userspace_stack(osb) &&
36073607
lockres->l_ops->flags & LOCK_TYPE_USES_LVB)
36083608
lvb = 1;
36093609

fs/ocfs2/stackglue.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ static char ocfs2_hb_ctl_path[OCFS2_MAX_HB_CTL_PATH] = "/sbin/ocfs2_hb_ctl";
4848
*/
4949
static struct ocfs2_stack_plugin *active_stack;
5050

51-
inline int ocfs2_is_o2cb_active(void)
52-
{
53-
return !strcmp(active_stack->sp_name, OCFS2_STACK_PLUGIN_O2CB);
54-
}
55-
EXPORT_SYMBOL_GPL(ocfs2_is_o2cb_active);
56-
5751
static struct ocfs2_stack_plugin *ocfs2_stack_lookup(const char *name)
5852
{
5953
struct ocfs2_stack_plugin *p;

fs/ocfs2/stackglue.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@ void ocfs2_stack_glue_set_max_proto_version(struct ocfs2_protocol_version *max_p
298298
int ocfs2_stack_glue_register(struct ocfs2_stack_plugin *plugin);
299299
void ocfs2_stack_glue_unregister(struct ocfs2_stack_plugin *plugin);
300300

301-
/* In ocfs2_downconvert_lock(), we need to know which stack we are using */
302-
int ocfs2_is_o2cb_active(void);
303-
304301
extern struct kset *ocfs2_kset;
305302

306303
#endif /* STACKGLUE_H */

0 commit comments

Comments
 (0)