commit 46b505867c569779617ef79297341697cecbce4d
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Wed May 30 16:34:30 2007 -0400

    Revert "Unionfs: Cleanup locking in new_dentry_private_data"
    
    This reverts commit a48f757714d7e70878461c5393de787e1497a612.
    
    Conflicts:
    
        fs/unionfs/lookup.c

diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index 86b24f0..663de69 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -417,19 +417,24 @@ int new_dentry_private_data(struct dentry *dentry)
        int size;
        struct unionfs_dentry_info *info = UNIONFS_D(dentry);
        void *p;
+       int unlock_on_err = 0;
 
        if (!info) {
-               info = kmem_cache_alloc(unionfs_dentry_cachep, GFP_ATOMIC);
+               dentry->d_fsdata = kmem_cache_alloc(unionfs_dentry_cachep,
+                                                   GFP_ATOMIC);
+               info = UNIONFS_D(dentry);
                if (!info)
                        goto out;
 
                mutex_init(&info->lock);
+               unionfs_lock_dentry(dentry);
+               unlock_on_err = 1;
+
                info->lower_paths = NULL;
        }
 
-       mutex_lock(&info->lock);
-
-       info->bstart = info->bend = -1;
+       info->bstart = -1;
+       info->bend = -1;
        info->bcount = sbmax(dentry->d_sb);
        info->odf.dentry = NULL;
        atomic_set(&info->generation,
@@ -444,13 +449,12 @@ int new_dentry_private_data(struct dentry *dentry)
        info->lower_paths = p;
        memset(info->lower_paths, 0, size);
 
-       /* ok, set the dentry private data pointer */
-       dentry->d_fsdata = info;
        return 0;
 
 out_free:
        kfree(info->lower_paths);
-       mutex_unlock(&info->lock);
+       if (unlock_on_err)
+               unionfs_unlock_dentry(dentry);
 
 out:
        free_dentry_private_data(info);
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to