aboutsummaryrefslogtreecommitdiff
path: root/kernel/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/file.c')
-rw-r--r--kernel/file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/file.c b/kernel/file.c
index aa9dba3..a08d236 100644
--- a/kernel/file.c
+++ b/kernel/file.c
@@ -618,8 +618,12 @@ static ssize_t fuse_send_write(struct fuse_req *req, int writepage,
req->out.args[0].value = &outarg;
request_send(fc, req);
res = req->out.h.error;
- if (!res)
- return outarg.size;
+ if (!res) {
+ if (outarg.size > count)
+ return -EPROTO;
+ else
+ return outarg.size;
+ }
else
return res;
}