Skip to content

Commit

Permalink
virtio-fs: add error check in fs
Browse files Browse the repository at this point in the history
Ref #1094

Signed-off-by: Fotis Xenakis <foxen@windowslive.com>
Message-Id: <AM0PR03MB62920B03A55C363D6778498EA6700@AM0PR03MB6292.eurprd03.prod.outlook.com>
  • Loading branch information
foxeng authored and wkozaczuk committed Aug 4, 2020
1 parent d3f2af6 commit 1ed4a9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/virtiofs/virtiofs_vfsops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1ed4a9d

Please sign in to comment.