Ref
https://github.com/cloudius-systems/osv/issues/1094
Signed-off-by: Fotis Xenakis <
fo...@windowslive.com>
---
fs/virtiofs/virtiofs_vfsops.cc | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/virtiofs/virtiofs_vfsops.cc b/fs/virtiofs/virtiofs_vfsops.cc
index 64855b73..d44e160d 100644
--- a/fs/virtiofs/virtiofs_vfsops.cc
+++ b/fs/virtiofs/virtiofs_vfsops.cc
@@ -55,12 +55,15 @@ std::pair<size_t, int> fuse_req_send_and_receive_reply(virtio::fs* drv,
req->output_args_size = output_args_size;
assert(drv);
- drv->make_request(*req);
+ int error = drv->make_request(*req);
+ if (error) {
+ return std::make_pair(0, error);
+ }
req->wait();
// return the length of the response's payload
size_t len = req->out_header.len - sizeof(fuse_out_header);
- int error = -req->out_header.error;
+ error = -req->out_header.error;
return std::make_pair(len, error);
}
--
2.28.0