Unionfs: d_parent related locking fixes
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 25 Jan 2008 21:04:18 +0000 (16:04 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 12 Aug 2011 02:37:31 +0000 (22:37 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/copyup.c
fs/unionfs/union.h

index 8663224c153d6c5662c842176c57d52c610734ec..9beac01c68b729bffb46bc704935e01938c9a51c 100644 (file)
@@ -716,8 +716,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 9295ee24911a3a7dd9308194bb1ba7c3657e25f3..14577bc997a62684795b207c3ea7a647fdb9448c 100644 (file)
@@ -494,13 +494,13 @@ 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;
 }
 static inline struct dentry *lock_parent_wh(struct dentry *dentry)
 {
-       struct dentry *dir = dget(dentry->d_parent);
+       struct dentry *dir = dget_parent(dentry);
 
        mutex_lock_nested(&dir->d_inode->i_mutex, UNIONFS_DMUTEX_WHITEOUT);
        return dir;