Unionfs: d_parent related locking fixes
authorRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Mon, 25 Feb 2008 00:34:00 +0000 (19:34 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Mon, 25 Feb 2008 00:34:00 +0000 (19:34 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/copyup.c
fs/unionfs/union.h

index c4cd254e7c159b0ef08a06bd4204219a1ad723ee..9002ec7cbe2ea4e9fdce42a48b890791222b8556 100644 (file)
@@ -722,8 +722,7 @@ struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
                child_dentry = parent_dentry;
 
                /* find the parent directory dentry in unionfs */
-               parent_dentry = child_dentry->d_parent;
-               dget(parent_dentry);
+               parent_dentry = dget_parent(child_dentry);
 
                /* find out the lower_parent_dentry in the given branch */
                lower_parent_dentry =
index 315fe2302c47b25f00f74495747014f648f3c1f8..1cade8893bde96078903b5cfc87f54c43d6176e4 100644 (file)
@@ -488,7 +488,7 @@ extern int parse_branch_mode(const char *name, int *perms);
 /* locking helpers */
 static inline struct dentry *lock_parent(struct dentry *dentry)
 {
-       struct dentry *dir = dget(dentry->d_parent);
+       struct dentry *dir = dget_parent(dentry);
        mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
        return dir;
 }