|
@@ -1720,7 +1720,10 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
|
|
unlink_target:
|
|
unlink_target:
|
|
/* Try unlinking the target dentry if it's not negative */
|
|
/* Try unlinking the target dentry if it's not negative */
|
|
if (target_dentry->d_inode && (rc == -EACCES || rc == -EEXIST)) {
|
|
if (target_dentry->d_inode && (rc == -EACCES || rc == -EEXIST)) {
|
|
- tmprc = cifs_unlink(target_dir, target_dentry);
|
|
|
|
|
|
+ if (d_is_dir(target_dentry))
|
|
|
|
+ tmprc = cifs_rmdir(target_dir, target_dentry);
|
|
|
|
+ else
|
|
|
|
+ tmprc = cifs_unlink(target_dir, target_dentry);
|
|
if (tmprc)
|
|
if (tmprc)
|
|
goto cifs_rename_exit;
|
|
goto cifs_rename_exit;
|
|
rc = cifs_do_rename(xid, source_dentry, from_name,
|
|
rc = cifs_do_rename(xid, source_dentry, from_name,
|