Let’s start with the scenario where the problem occurs:
two Linux servers mount via samba, one for writing files and one for reading files. To prevent files from being read before they are written, a temporary file name is used first, then a rename
As a result, there is a problem that rename calls successfully, but the file name does not change. Mv command is executed manually and the error is “are the same file”. This situation occurs frequently after a machine is rebooted.
All kinds of search on the Internet, there is no appropriate keywords, search not useful information. I suddenly remembered to look at Dmesg and found useful error messages
CIFS VFS: Unexpected lookup error -112
CIFS VFS: cifs_mount failed w/return code = -112
CIFS VFS: Unexpected lookup error -112
Using this keyword to search the solution, tried renaming success
echo 0 > /proc/fs/cifs/OplockEnabled
# The following sentence didn't work. Renaming was successful.
echo 0 > /proc/fs/cifs/LookupCacheEnabled