[patch 25/71] ocfs2: Increment the reference count of analready-active stack.

From: Greg KH
Date: Mon Oct 06 2008 - 20:49:45 EST


2.6.26-stable review patch. If anyone has any objections, please let us
know.

------------------
From: Joel Becker <Joel.Becker@xxxxxxxxxx>

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@xxxxxxxxxx>
Tested-by: Marcos Matsunaga <marcos.matsunaga@xxxxxxxxxx>
Signed-off-by: Mark Fasheh <mfasheh@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
fs/ocfs2/stackglue.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -97,13 +97,14 @@ static int ocfs2_stack_driver_request(co
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;
}

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/