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

index b1fe356d759f1c7c27e79d14f8f09110a2c2ece6..9dc881dc8cfb8f7054ba59cf8959770911f9ce40 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