New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix inconsistent caching of VM xchg dirs #82258
Conversation
dadc347
to
157b649
Compare
@JJJollyjim, can you take a look at this? @erikarvstedt We might also then be able to drop the |
It's probably fine to not cache - I doubt there's anything performance critical with a lot of IO exchanged via these folders. |
@flokli removing the |
I consider the If we add back some caching, it should properly invalidate caches on external changes (like an nfs share would do), so we should remove these workarounds - please drop the |
157b649
to
a061b4b
Compare
I've had a thorough look at these syncs now.
|
These syncs have the goal to transfer host filesystem changes to the VM, but they have no effect because 1) syncing in the VM can't possibly pull in host data and 2) 9p is accessing the host filesystem on the cached layer anyways, so even syncing on the host would have no effect in the VM.
a061b4b
to
be90039
Compare
I think your reasoning is correct. Can you prefix the second commit, too ( Also, slightly off-topic, but did you see #85568? |
xchg is advertised as a bidirectional exchange dir, but file content transfer from host to VM fails due to caching: If a file is read in the VM and then modified on the host, subsequent re-reads in the VM can yield old, cached data. This is caused by the use of 9p's cache=loose mode that is explicitly meant for read-only mounts. 9p doesn't provide any suitable cache modes, so fix this by disabling caching. Also, remove a now unnecessary sync in the test driver.
be90039
to
d85dc4f
Compare
I'll keep an eye on #85568 and jump in when I see new caching-related issues arise. |
Thanks! |
xchg is advertised as a bidirectional exchange dir, but file content transfer from host to VM fails due to caching:
If a file is read in the VM and then modified on the host, subsequent re-reads in the VM can yield old, cached data.
This is caused by the use of 9p's
cache=loose
mode that is explicitly meant for read-only mounts.TODO
Would it be sensible to use
cache=mmap
(doc) instead?Reproduce
This script reproduces the bug.
Ping @domenkozar, @aszlig