]> git.hungrycats.org Git - linux/commitdiff
[PATCH] exp_parent locking fixes
authorAndrew Morton <akpm@digeo.com>
Thu, 3 Apr 2003 00:28:42 +0000 (16:28 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 3 Apr 2003 00:28:42 +0000 (16:28 -0800)
From: Neil Brown and myself.

Don't do dput() inside read_lock().  It can sleep.

fs/nfsd/export.c

index 0555cd4f3037cab59cd73820f09afff90ce2d70c..21e60185f08ef880bd054297ed2303a6e5bbbc68 100644 (file)
@@ -543,13 +543,13 @@ exp_parent(svc_client *clp, struct vfsmount *mnt, struct dentry *dentry,
        dget(dentry);
        exp = exp_get_by_name(clp, mnt, dentry, reqp);
 
-       while (exp == NULL && dentry != dentry->d_parent) {
+       while (exp == NULL && !IS_ROOT(dentry)) {
                struct dentry *parent;
                read_lock(&dparent_lock);
                parent = dget(dentry->d_parent);
+               read_unlock(&dparent_lock);
                dput(dentry);
                dentry = parent;
-               read_unlock(&dparent_lock);
                exp = exp_get_by_name(clp, mnt, dentry, reqp);
        }
        dput(dentry);