crosvm/fuse
Victor Hsieh 5c4e0347e1 Drain the read buffer of DevFuseReader
In some circumstances, it's possible that the buffered data isn't fully
consumed by the filesystem. Before handling the next request, we need to
drain the residual.

This change also moves the reader/writer/mapper out of the loop, since
we intend to not duplicate the FDs for each interation, and prefer to
reuse the buffer / avoid re-allocation anyway. This allows us to
implement `drain` in DevFuseReader.

BUG=b:196264590
TEST=fsverity measure a filesystem without ioctl impl, the filesystem
     does not crash any more

Cq-Depend: chromium:3105916
Change-Id: Ib758c98e6d7b4ce1391c51db19c120a4cec09dff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3092409
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Victor Hsieh <victorhsieh@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
2021-08-24 18:41:30 +00:00
..
src Drain the read buffer of DevFuseReader 2021-08-24 18:41:30 +00:00
Cargo.toml Add newlines to end of Cargo.toml files. 2021-08-17 20:20:41 +00:00