vhost-user-fs: return correct result of fs_slave_io()

Virtio-fs daemon expects fs_slave_io() returns the number of bytes
read/written on success, but we always return 0 and make userspace think
nothing has been read/written.

Fix it by returning the actual bytes read/written. Note that This
depends on the corresponding fix in vhost crate.

Fixes: #949
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
This commit is contained in:
Eryu Guan
2020-03-24 19:54:17 +08:00
committed by Sebastien Boeuf
parent bbc385c3f3
commit 18fbd303ab
3 changed files with 15 additions and 12 deletions

View File

@@ -42,7 +42,8 @@ impl FsCacheReqHandler for SlaveFsCacheReq {
VhostUserFSSlaveMsgFlags::MAP_R
};
self.fs_slave_map(&msg, fd)
self.fs_slave_map(&msg, fd)?;
Ok(())
}
fn unmap(&mut self, requests: Vec<fuse::RemovemappingOne>) -> io::Result<()> {