diff options
-rw-r--r-- | fs/ncpfs/dir.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index 81c287d105d5..9c51f621e901 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c | |||
@@ -1144,8 +1144,16 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1144 | old_dentry->d_parent->d_name.name, old_dentry->d_name.name, | 1144 | old_dentry->d_parent->d_name.name, old_dentry->d_name.name, |
1145 | new_dentry->d_parent->d_name.name, new_dentry->d_name.name); | 1145 | new_dentry->d_parent->d_name.name, new_dentry->d_name.name); |
1146 | 1146 | ||
1147 | if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode)) | 1147 | if (new_dentry->d_inode && S_ISDIR(new_dentry->d_inode->i_mode)) { |
1148 | /* | ||
1149 | * fail with EBUSY if there are still references to this | ||
1150 | * directory. | ||
1151 | */ | ||
1148 | dentry_unhash(new_dentry); | 1152 | dentry_unhash(new_dentry); |
1153 | error = -EBUSY; | ||
1154 | if (!d_unhashed(new_dentry)) | ||
1155 | goto out; | ||
1156 | } | ||
1149 | 1157 | ||
1150 | ncp_age_dentry(server, old_dentry); | 1158 | ncp_age_dentry(server, old_dentry); |
1151 | ncp_age_dentry(server, new_dentry); | 1159 | ncp_age_dentry(server, new_dentry); |