Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
os: TestLongPath failing on Plan 9 #17855
CL 32451 added TestLongPath. However this test is failing on Plan 9.
The problem is that after the call to
If we replace the call of
The problem seems to only happen on the Fossil file server and not on ramfs or cwfs.
This issue is caused by the devmnt cache in the Plan 9 kernel.
The file content is cached when writing the file. When reading the file, the content is firstly read from the cache (12 bytes), then the remaining is read from the file server (offset=12 > length=0, so 0 bytes). So devmnt, returns the 12 bytes "hello world" from the cache. This is happening because the call to wstat, which sets the file length to zero, doesn't invalidate the cache.
The fix would probably be to invalidate the cache on wstat when setting the length to zero.
I can reproduce the issue with other file servers like ramfs by mounting with the cache enabled (-C).