Skip to content

Commit d6817cd

Browse files
Joel BeckerMark Fasheh
authored andcommitted
ocfs2: Increment the reference count of an already-active stack.
The ocfs2_stack_driver_request() function failed to increment the refcount of an already-active stack. It only did the increment on the first reference. Whoops. Signed-off-by: Joel Becker <joel.becker@oracle.com> Tested-by: Marcos Matsunaga <marcos.matsunaga@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
1 parent de6bf18 commit d6817cd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎fs/ocfs2/stackglue.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@ static int ocfs2_stack_driver_request(const char *stack_name,
9797
goto out;
9898
}
9999

100-
/* Ok, the stack is pinned */
101-
p->sp_count++;
102100
active_stack = p;
103-
104101
rc = 0;
105102

106103
out:
104+
/* If we found it, pin it */
105+
if (!rc)
106+
active_stack->sp_count++;
107+
107108
spin_unlock(&ocfs2_stack_lock);
108109
return rc;
109110
}

0 commit comments

Comments
 (0)