Opened 10 years ago
Closed 6 years ago
#14746 closed defect (fixed)
vboxsf Linux guest - File Cache -> Fixed in SVN / 6.0.6
Reported by: | Tom B | Owned by: | |
---|---|---|---|
Component: | shared folders | Version: | VirtualBox 5.0.6 |
Keywords: | vboxsf shared file cache | Cc: | |
Guest type: | Linux | Host type: | all |
Description
I'm using a Linux guest using a basic Arch Linux install (default kernel, very few packages)
I have a problem with file caching in shared folders. Steps to reproduce:
1) GUEST: mount a shared directory: mount -t vboxsf share_name /media/share
2) GUEST: cat /media/share/existing.file
<-- Works perfectly, displays the contents of the file from HOST
3) HOST: Write new.file into the shared folder:
4) GUEST: cat /media/share/new.file
<-- Works perfectly, displays contents of newly created file
5) GUEST: stat /media/share/non-existing.file
<-- As expected displays "no such file or directory"
6) HOST: Write non-existing.file to the shared directory
7) GUEST: cat /media/share/non-existing.file
<-- THIS SHOULD WORK NOW AS THE FILE EXISTS BUT INSTEAD SHOWS "No such file or directory"
When typing ls /media-share
it shows the file with ??? for permissions, dates, etc.
If the file is written on the host BEFORE trying to access it on the guest it works as expected. If the guest tries to read the file prior to it's existence, the fact it doesn't exist is cached and the guest cannot see the file after it's been created.
This is the same for both windows and linux hosts with this guest.
Running echo 3 > /proc/sys/vm/drop_caches
to clear the file cache seems to fix it.
As far as I can tell it's an issue with the file cache. I've tried recompiling the guest's kernel with various options for CONFIG_FSCACHE (arch defaults to =m and the module is not loaded on the guest)
Is there a fix for this?
4) GUEST: cat new.file
Change History (4)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
After further testing running
touch -a new.file
on the inaccessible file, makes it accessible.
Although I'm further towards a solution I think it needs to be implemented by Oracle.
Ideally I should be able to mount the filesystem with the strictatime
option. However, vboxsf doesn't seem to support this:
mount -t vboxsf -o strictatime share_name ./share
unknown mount option strictatime
Setting atime
, and norelatime
work allows the share to be mounted but does not have the desired effect.
I believe that if vboxsf supported strictatime
it would resolve this problem.
comment:3 by , 9 years ago
I am having exactly this issue with 5.0.12 and docker-machine from Docker Toolbox 1.9.1i.
Really annoying !
@Tom B : Thank you for the workaround (echo 3 > /proc/sys/vm/drop_caches)
comment:4 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Summary: | vboxsf Linux guest - File Cache → vboxsf Linux guest - File Cache -> Fixed in SVN / 6.0.6 |
This should be fixed in 6.0.6 (if not earlier already).
I should also add that clearing the cache with
echo 3 > /proc/sys/vm/drop_caches
makes files written at that point visible but must be run each time a file is affected.