summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-11-03 20:05:08 +0100
committerSteve French <sfrench@us.ibm.com>2008-11-03 19:31:05 +0100
commitae6884a9da56f8921e432e663b4ccb4a1851b2ea (patch)
treeec80aca419ad61b7585ef0da64fac4d968ced224 /fs
parent[CIFS] fix error in smb_send2 (diff)
downloadlinux-ae6884a9da56f8921e432e663b4ccb4a1851b2ea.tar.xz
linux-ae6884a9da56f8921e432e663b4ccb4a1851b2ea.zip
cifs: fix renaming one hardlink on top of another
cifs: fix renaming one hardlink on top of another POSIX says that renaming one hardlink on top of another to the same inode is a no-op. We had the logic mostly right, but forgot to clear the return code. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index d54fa8aeaea9..ff8c68de4a92 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1361,9 +1361,11 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
CIFS_MOUNT_MAP_SPECIAL_CHR);
if (tmprc == 0 && (info_buf_source->UniqueId ==
- info_buf_target->UniqueId))
+ info_buf_target->UniqueId)) {
/* same file, POSIX says that this is a noop */
+ rc = 0;
goto cifs_rename_exit;
+ }
} /* else ... BB we could add the same check for Windows by
checking the UniqueId via FILE_INTERNAL_INFO */