Unionfs: use dget_parent in revalidation code
authorRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Fri, 29 Feb 2008 19:32:13 +0000 (14:32 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Fri, 29 Feb 2008 19:32:13 +0000 (14:32 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/dentry.c

index 85494a9f2d4ee6fcaa62dbdbd2d65315478c1623..113e9ae877400af2bc047badb05b99f384ce6e93 100644 (file)
@@ -428,15 +428,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