Bugzilla – Bug 1174505
rsync and mv command fails: "File exists" on cifs mount on kernel >= 5.7.8 with SMB protocol version 1.0
Last modified: 2020-11-19 14:44:45 UTC
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
I have two folders shared on an old Windows retro gaming PC. In Tumbleweed I have those shares mounted via /etc/fstab using cifs and the SMB protocol option vers=1.0.
With kernel versions up to 5.7.7-1.2 rsync and mv would rename files correctly.
Since upgrading to kernel 5.7.9 rsync and mv are failing to rename files.
If I downgrade to kernel 5.7.7-1.2 rsync and mv can rename files again.
I've read that this only affects kernels >=5.7.8 in combination with cifs SMB protocol 1.0.
I found this discussion on the samba mailing list where someone else has already reported the problem and it specifically mentions the kernel patch which introduced the regression:
Steps to Reproduce:
1.touch foo bar
2.mv -f foo bar
touch foo bar
mv -f foo bar
mv: cannot move 'foo' to 'bar': File exists
renamed 'foo' -> 'bar'
While I don't use an LTS kernel, I've noticed other users report the same problem:
This was reverted upstream but the patch did fix some wrong behaviour for smb2 which is the supported version of the protocol.
Is there any reason you have to keep on using smb version 1.0? Could you try 2.1 or 3.0?
The legacy systems only support smb version 1.0 but I can work around it though.
To be honest, I wasn't sure if this was just another one of those things as the technology gap increases between old retro PCs and newer PCs.
I must confess that a lot (most actually) of the technical aspects where way over my head, but finding that it wasn't just an oddity at my end I thought I'd better report it and see what others think.
I understand that to properly fix the problem it will take a lot of time, especially for an old unsupported protocol, and for my simple needs I can easily work around it.
Thank you for your time.
Let me close then. I don't think anyone is interested in 1.0 protocol upstream and since there is a workaround for you, we can move on.