index icon indicating copy to clipboard operation
index copied to clipboard

Support for short read/write pread/pwrite should be tested more

Open tomjridge opened this issue 4 years ago • 4 comments

Support for short read/write pread/pwrite should be tested more.

I vaguely recall a FUSE filesystem that could make all read/write calls into short read/write calls, and could also do various other kinds of filesystem-allowed-but-rarely-tested behaviours. Would be good to find this and use it in testing.

tomjridge avatar Nov 17 '21 12:11 tomjridge

(And this issue could also be made for Irmin)

tomjridge avatar Nov 17 '21 12:11 tomjridge

Could be related to https://github.com/mirage/irmin/issues/1197

Ngoguey42 avatar Nov 17 '21 12:11 Ngoguey42

Possibly also related to #256

tomjridge avatar Nov 19 '21 14:11 tomjridge

I have been attempting to encourage the filesystem to return "short" reads and writes, so we can test these behaviours easily.

One thing I tried was to use "max_read" and "max_write" FUSE options with a passthrough FUSE filesystem. Unfortunately (at least for the fusexmp from ocamlfuse) these options do not seem to be respected.

Other possibly-related bugs appeared on WSL running a 9p FS. I tried to reproduce on Linux using diod (a 9p server/client). However, the tests all passed (unfortunately). So, in terms of trying to elicit errors, diod is worse than WSL 9p.

Effectively all we want is for read/write (or pread/pwrite) to return short read/writes. I researched quite a lot on the web because I thought there was a tool that could do this. Unfortunately I couldn't find one. So I will spend another hour or so coding a FUSE passthrough FS with this "short read/write" behaviour. If the tests still pass then at least we have confidence that our code is well tested under this scenario.

tomjridge avatar Nov 19 '21 15:11 tomjridge