]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ocfs2: Increment the reference count of an already-active stack.
authorJoel Becker <Joel.Becker@oracle.com>
Wed, 10 Sep 2008 13:27:07 +0000 (06:27 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Oct 2008 03:22:58 +0000 (20:22 -0700)
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>
fs/ocfs2/stackglue.c

index 10e149ae5e3aad289f3070714ef5b8530078acf0..07f348b8d721064a3753012dc22c7ab21a834d55 100644 (file)
@@ -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;
 }