From 623e3fb77f0db6d91b520c6a576cacd97ea38607 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 14 Sep 2011 16:08:29 -0700 Subject: [PATCH] --- yaml --- r: 263783 b: refs/heads/master c: 53d872e99520bbc7d83c34a416144e591ef69584 h: refs/heads/master i: 263781: 8df686cb09e2f4b4b742ac4ac0471ab621009380 263779: a4d3abb36686fd8b83be5bc7267164c37b8ed5df 263775: 07b2892cbe793b41c0b87013175f034acfa5b977 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 60fc62c1cc2c..81bc1dd318bb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2d2422aebc037095f77551119f795449d29befed +refs/heads/master: 53d872e99520bbc7d83c34a416144e591ef69584 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index b52bc685465f..f4788365ea22 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -2616,6 +2616,7 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry) if (!dir->i_op->rmdir) return -EPERM; + dget(dentry); mutex_lock(&dentry->d_inode->i_mutex); error = -EBUSY; @@ -2636,6 +2637,7 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry) out: mutex_unlock(&dentry->d_inode->i_mutex); + dput(dentry); if (!error) d_delete(dentry); return error; @@ -3025,6 +3027,7 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, if (error) return error; + dget(new_dentry); if (target) mutex_lock(&target->i_mutex); @@ -3045,6 +3048,7 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, out: if (target) mutex_unlock(&target->i_mutex); + dput(new_dentry); if (!error) if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE)) d_move(old_dentry,new_dentry);