summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Becker <Joel.Becker@oracle.com>2008-08-22 23:30:10 +0200
committerMark Fasheh <mfasheh@suse.com>2008-08-25 16:29:47 +0200
commitd6817cdbd143f87f9d7c59a4c3194091190eeb84 (patch)
tree5744bb0cb5d3083f37674d845576d61431b4ebb3
parent[PATCH] configfs: Consolidate locking around configfs_detach_prep() in config... (diff)
downloadlinux-d6817cdbd143f87f9d7c59a4c3194091190eeb84.tar.xz
linux-d6817cdbd143f87f9d7c59a4c3194091190eeb84.zip
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>
-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;
}