aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Becker <Joel.Becker@oracle.com>2008-09-10 06:27:07 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-08 20:22:58 -0700
commit2e8e9ac3bd989d4a654b7750e04a6ce5f60b0dc5 (patch)
treefd51f8a2f48d0e608165ec3b614bd5e214571912
parent90af668a965fd4732996274c7babfc63b090ddf0 (diff)
ocfs2: Increment the reference count of an already-active stack.
commit d6817cdbd143f87f9d7c59a4c3194091190eeb84 upstream 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/ocfs2/stackglue.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index 10e149ae5e3a..07f348b8d721 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -97,13 +97,14 @@ static int ocfs2_stack_driver_request(const char *stack_name,
goto out;
}
- /* Ok, the stack is pinned */
- p->sp_count++;
active_stack = p;
-
rc = 0;
out:
+ /* If we found it, pin it */
+ if (!rc)
+ active_stack->sp_count++;
+
spin_unlock(&ocfs2_stack_lock);
return rc;
}