Commit 24e93025 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Trond Myklebust

nfs: clean up sillyrenaming in nfs_rename()

The d_instantiate(new_dentry, NULL) is superfluous, the dentry is
already negative.  Rehashing this dummy dentry isn't needed either,
d_move() works fine on an unhashed target.

The re-checking for busy after a failed nfs_sillyrename() is bogus
too: new_dentry->d_count < 2 would be a bug here.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 27226104
...@@ -1611,14 +1611,11 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1611,14 +1611,11 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
/* silly-rename the existing target ... */ /* silly-rename the existing target ... */
err = nfs_sillyrename(new_dir, new_dentry); err = nfs_sillyrename(new_dir, new_dentry);
if (!err) { if (err)
new_dentry = rehash = dentry;
new_inode = NULL;
/* instantiate the replacement target */
d_instantiate(new_dentry, NULL);
} else if (atomic_read(&new_dentry->d_count) > 1)
/* dentry still busy? */
goto out; goto out;
new_dentry = dentry;
new_inode = NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment