[PATCH] virtio-fs: add error check in fs

7 views
Skip to first unread message

Fotis Xenakis

unread,
Jul 29, 2020, 7:43:48 PM7/29/20
to osv...@googlegroups.com, Fotis Xenakis
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

Commit Bot

unread,
Aug 5, 2020, 9:50:30 AM8/5/20
to osv...@googlegroups.com, Fotis Xenakis
From: Fotis Xenakis <fo...@windowslive.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

virtio-fs: add error check in fs
Message-Id: <AM0PR03MB62920B03A5...@AM0PR03MB6292.eurprd03.prod.outlook.com>

---
diff --git a/fs/virtiofs/virtiofs_vfsops.cc b/fs/virtiofs/virtiofs_vfsops.cc
Reply all
Reply to author
Forward
0 new messages