[I originally posted about this on the vi/vim stackexchange, but it's increasingly clear that the core issue is more the filesystem than the editor that's complaining about it]
TL;DR -- Files on a CIFS mount are "changing" in the background in a way that alarms Vim when I try to write to them. I need help either calming Vim or removing the underlying "modification" noise.
- I have a Linux Guest virtual machine (Arch/Manjaro-i3 64-bit) running on VirtualBox under a Windows 10 Host machine.
- The host machine has a partition formatted as NTFS that is intended to be shared between the two.
- The shared partition is shared via standard Windows 10 sharing, and mounted on the Linux guest as a cifs drive in /etc/fstab.
- I'm editing files from the Guest system using vim 8.1.
- Most of the time (apparently at random) I try to :write a file I'm editing in vim, I get
WARNING: The file has been changed since reading it!!!
- I know the contents have not changed on disk between the two writes.
I want to prevent the bogus warning, and also to better understand how to examine its provenance.
Basically, immediately after I write a file to disk, something is making a triggering modification to the file. I suspect the Samba infrastructure, but I'm not sure how to pin this down. I've looked at strace logs, but I'm not super skilled at making sense of that data.
I suspect the issue is some latency between when vim thinks it timestamped the file, and what timestamp gets recorded by Samba when it eventually sees the write-op, such that vim thinks it might be out of date.
But I'm not sure... And if that's true, I'm still not savvy enough to fix it.