GIT: unionfs2-2.6.27.y: Unionfs: d_parent related locking fixes

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:17:45 EDT 2010


commit 24d458a78522620cb986c03e11eeab971c089628
Author: Erez Zadok <ezk at cs.sunysb.edu>
Date:   Fri Jan 25 16:04:18 2008 -0500

    Unionfs: d_parent related locking fixes
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c
index 8663224..9beac01 100644
--- a/fs/unionfs/copyup.c
+++ b/fs/unionfs/copyup.c
@@ -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 =
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index 9295ee2..14577bc 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -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;


More information about the unionfs-cvs mailing list