File goes missing for a short period of time after saving it using VIM
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eCryptfs |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
This bug started as a question on unix.stackexcha
I am having a strange problem that seams to be caused by VIM, the Linux VFS cache, ecryptfs and/or something file system related:
1. I open a file in VIM, modify it and save it.
2. I try to access the file.
##Expected behaviour
The file should be accessible as soon as :w reports the file as written.
##Actual behaviour
The file does not exist.
If I wait a bit (usually less then a second) the file turns up.
This is especially cumbersome when working with Python code and left over pyc files. I often ended up starting the old code as the new py file was not ready, yet. I recently added export PYTHONDONTWRITE
##System details and configuration
My machine has plenty of RAM (32 GiB), an SSD and is basicly idle. Therefore I do not think that slow I/O is causing this. The file is very small (<1 KiB) and it also happens for empty files. I am using a crypted $HOME using ecryptfs so this might be part of the problem. I was unable to reproduce this on my /tmp mount which uses a tmpfs file system.
##VIM settings
The reason why the file is moved away and replaced by a new file is caused by my VIM settings:
set backup
set backupskip=
set backupdir=
set writebackup
I would expect the new file to be accessible right after VIM reports that the file has been written. I checked the VIM documentation for any hints of a delayed write, but did not find anything. I was unable to reproduce this using the shell commands mv, cp and rm so I think VIM is doing something different.
##Distribution and software versions
I'm running Ubuntu GNU/Linux 12.10 x86_64 with ecryptfs-utils 100.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
$ uname -a
Linux blackhole 3.5.0-22-generic #34-Ubuntu SMP Tue Jan 8 21:47:00 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ apt-cache show ecryptfs-utils |grep Version
Version: 100-0ubuntu1
Thanks for the bug report, Michael. As I mentioned on stackexchange, I'm unable to reproduce the bug. Can you elaborate a bit on how you try to access the file in step 2? Different commands are going to result in different system call sequences, so maybe that's the reason why I'm not seeing the bug.