]> git.hungrycats.org Git - linux/commitdiff
driverfs: decrement refcount on dentry being removed, not directory
authorPatrick Mochel <mochel@osdl.org>
Mon, 5 Aug 2002 04:13:08 +0000 (21:13 -0700)
committerPatrick Mochel <mochel@osdl.org>
Mon, 5 Aug 2002 04:13:08 +0000 (21:13 -0700)
This brain fart is left over from some cleanup of these functions a _long_
time ago. We need to dput() the dentry, since we have an implicit count of
one left over from the create function.

Instead, we were dput() on the directory that it was in, which we didn't
have a matching dget() for.

fs/driverfs/inode.c

index 0767cfa7274c876c98501145c8aba76020943f30..af41d842ef96f1eed06805edd68bf139b4957251 100644 (file)
@@ -56,7 +56,6 @@ static struct vfsmount *driverfs_mount;
 static spinlock_t mount_lock = SPIN_LOCK_UNLOCKED;
 static int mount_count = 0;
 
-
 static int driverfs_readpage(struct file *file, struct page * page)
 {
        if (!PageUptodate(page)) {
@@ -690,7 +689,7 @@ void driverfs_remove_file(struct driver_dir_entry * dir, const char * name)
                if (dentry->d_inode && 
                    (dentry->d_parent->d_inode == dir->dentry->d_inode)) {
                        driverfs_unlink(dir->dentry->d_inode,dentry);
-                       dput(dir->dentry);
+                       dput(dentry);
                        put_mount();
                }
        }
@@ -722,7 +721,7 @@ void driverfs_remove_dir(struct driver_dir_entry * dir)
 
                node = node->next;
                driverfs_unlink(dentry->d_inode,d);
-               dput(dentry);
+               dput(d);
                put_mount();
        }
        up(&dentry->d_inode->i_sem);