commit aa62268cc4d34bfec4e0e9d62851f232a96f3527
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Mon May 14 21:28:00 2007 -0400

    export: fixed some reference leaks

diff --git a/fs/unionfs/export.c b/fs/unionfs/export.c
index 
f37c6c975f5b56c0da5a9ede0b7bcb4be41412ea..5710a1aa1e9388d08193a6ac3d3ba66497a5b295
 100644
--- a/fs/unionfs/export.c
+++ b/fs/unionfs/export.c
@@ -1,5 +1,7 @@
 #include "union.h"
 
+#define is_anon(d) ((d)->d_flags & DCACHE_DISCONNECTED)
+
 static struct dentry *__get_parent(struct super_block *sb, struct dentry 
*odf_dentry)
 {
        struct dentry *odf_root = UNIONFS_SB(sb)->odf->odi_ns->dentry;
@@ -21,12 +23,13 @@ static struct dentry *__get_parent(struc
        } while (d != odf_root);
 
        parent = sb->s_root;
+       dget(parent);
        while (stack.n) {
                d = __ds_pop(&stack);
                child = lookup_one_len(d->d_name.name, parent, d->d_name.len);
+               dput(parent);
                if (IS_ERR(child))
                        break;
-               dput(parent);
                parent = child;
        }
 
@@ -61,13 +64,15 @@ static struct dentry *unionfs_get_parent
 
        odf_parent = odf_sb->s_export_op->get_parent(odf_child);
        if (IS_ERR(odf_parent)) {
-               iput(odf_i);
+               dput(odf_child);
                res = odf_parent;
                goto out;
        }
 
        res = __get_parent(child->d_sb, odf_parent);
 
+       dput(odf_child);
+       dput(odf_parent);
 out:
        return res;
 }
@@ -142,10 +147,9 @@ static int unionfs_get_name(struct dentr
                        strncpy(name, tmp_name, namelen);
                        name[namelen] = 0;
                        err = 0;
-                       
                        break;
                }
-               
+
                err = -ENOENT;
                kfree(tmp_name);
                tmp_name = NULL;
diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
index 
50cfc9398819ca28a88eed6088800f6b2dcf00e8..8f9d38bb6971b4715889a6097abb8678e1e5944a
 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -408,7 +408,7 @@ static int unionfs_mkdir(struct inode *p
        err = odf_purge_dir_cache(dentry->d_parent);
        if (err)
                goto out;
-       
+
        /* only INTERPOSE_LOOKUP can return a value other than 0 or err */
        err = PTR_ERR(unionfs_interpose(dentry, parent->i_sb, 0));
        if (!err) {
diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
index 
72e62fcbf000b7a3218ea9a9d0083188b0f8a355..b2f0e7dbab72bf6cb939fd3873d8d8f028f6e941
 100644
--- a/fs/unionfs/main.c
+++ b/fs/unionfs/main.c
@@ -149,8 +149,8 @@ fill_i_info:
        /* all well, copy inode attributes */
        fsstack_copy_attr_all(inode, hidden_inode, unionfs_get_nlinks);
        fsstack_copy_inode_size(inode, hidden_inode);
-       
-       if(spliced) 
+
+       if(spliced)
                goto out_spliced;
 skip:
        /* only (our) lookup wants to do a d_add */
@@ -167,7 +167,7 @@ skip:
                /* d_splice can return a dentry if it was disconnected
                 * and had to be moved. We must make sure that the pd
                 * of the new dentry is correct and that the inode info
-                * was filled properly. Finally we must return this new 
+                * was filled properly. Finally we must return this new
                 * dentry
                 */
                else if (spliced && spliced != dentry) {
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to