Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae6884a9 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French
Browse files

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: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 61de800d
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1361,9 +1361,11 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
					CIFS_MOUNT_MAP_SPECIAL_CHR);
					CIFS_MOUNT_MAP_SPECIAL_CHR);


		if (tmprc == 0 && (info_buf_source->UniqueId ==
		if (tmprc == 0 && (info_buf_source->UniqueId ==
				   info_buf_target->UniqueId))
				   info_buf_target->UniqueId)) {
			/* same file, POSIX says that this is a noop */
			/* same file, POSIX says that this is a noop */
			rc = 0;
			goto cifs_rename_exit;
			goto cifs_rename_exit;
		}
	} /* else ... BB we could add the same check for Windows by
	} /* else ... BB we could add the same check for Windows by
		     checking the UniqueId via FILE_INTERNAL_INFO */
		     checking the UniqueId via FILE_INTERNAL_INFO */