Skip to contentSkip to conversation

ocfs2: Increment the reference count of an already-active stack.

PATCH New Joel Becker 1 participant 1 message Aug 22, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/ocfs2/stackglue.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
fs/ocfs2/stackglue.c +4 -3
index 10e149a..07f348b 100644
@@ -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;
 }
Signature · 14 lines
1.5.6.3


-- 

Life's Little Instruction Book #356

	"Be there when people need you."

Joel Becker
Principal Software Developer
Oracle
E-mail: [email protected]
Phone: (650) 506-8127