diff options
author | Jean-Pierre André <jpandre@users.noreply.github.com> | 2022-02-09 15:59:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 14:59:10 +0000 |
commit | 5128cee2dd0e54b74e9ea75dfc8cf70a866ee120 (patch) | |
tree | 5c4e6fb56a0a685b5a70fc4e1d3bff84f01f8b8e | |
parent | b08e275083d0316fa4d735d457869d62ce4114de (diff) | |
download | fuse-5128cee2dd0e54b74e9ea75dfc8cf70a866ee120.tar.gz |
Fixed returning an error condition to ioctl(2) (#641)
When returning a negative error code by ->ioctl() to the high level
interface, no error is propagated to the low level, and the reply
message to the kernel is shown as successful.
A negative result is however returned to kernel, so the kernel can
detect the bad condition, but this appears to not be the case since
kernel 5.15.
The proposed fix is more in line with the usual processing of errors
in fuse, taking into account that ioctl(2) always returns a non-negative
value in the absence of errors.
Co-authored-by: Jean-Pierre André <jpandre@users.sourceforge.net>
-rw-r--r-- | ChangeLog.rst | 2 | ||||
-rw-r--r-- | lib/fuse.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog.rst b/ChangeLog.rst index b97d61d..2dd8954 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -1,3 +1,5 @@ +* Fixed returning an error condition to ioctl(2) + libfuse 3.10.5 (2021-09-06) =========================== @@ -4289,6 +4289,8 @@ static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, unsigned int cmd, fuse_finish_interrupt(f, req, &d); free_path(f, ino, path); + if (err < 0) + goto err; fuse_reply_ioctl(req, err, out_buf, out_bufsz); goto out; err: |