Linux: always use afs_maybe_unlock_kernel
authorMarc Dionne <marc.c.dionne@gmail.com>
Sat, 7 Nov 2009 15:51:52 +0000 (10:51 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Sun, 8 Nov 2009 16:25:09 +0000 (08:25 -0800)
In one error case in afs_linux_lookup unlock_kernel() is called
directly instead of using the conditional "maybe" form.
If the config is such that the BKL is not taken, this can result
in an attempt to unlock when the lock has not been taken, and
can cause an oops.

Change-Id: I27d5db58e9b9d45d925b24e27bc43960499c6ead
Reviewed-on: http://gerrit.openafs.org/790
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/LINUX/osi_vnodeops.c

index 3d65d89..553e070 100644 (file)
@@ -1073,7 +1073,7 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
                dput(alias);
            } else {
                iput(ip);
-               unlock_kernel();
+               afs_maybe_unlock_kernel();
                crfree(credp);
                return alias;
            }