Unionfs: use dget_parent in revalidation code
authorErez Zadok <ezk@cs.sunysb.edu>
Sat, 16 Feb 2008 02:37:07 +0000 (21:37 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sat, 16 Feb 2008 02:37:07 +0000 (21:37 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/dentry.c

index a2009e8d99cb3d55f016d87e9b733692fe570d0a..b54fbc2db1a46986852a299edf19cda4818ddb2f 100644 (file)
@@ -403,15 +403,10 @@ bool __unionfs_d_revalidate_chain(struct dentry *dentry, struct nameidata *nd,
                goto out;
        }
 
-       /*
-        * lock all dentries in chain, in child to parent order.
-        * if failed, then sleep for a little, then retry.
-        */
-       dtmp = dentry->d_parent;
-       for (i = chain_len-1; i >= 0; i--) {
-               chain[i] = dget(dtmp);
-               dtmp = dtmp->d_parent;
-       }
+       /* grab all dentries in chain, in child to parent order */
+       dtmp = dentry;
+       for (i = chain_len-1; i >= 0; i--)
+               dtmp = chain[i] = dget_parent(dtmp);
 
        /*
         * call __unionfs_d_revalidate_one() on each dentry, but in parent