From 6ddd14f2b1093434e147498db7f3b7e9aff33088 Mon Sep 17 00:00:00 2001 From: Ken Schalk Date: Tue, 11 Jan 2022 14:56:36 -0500 Subject: Avoid ENOENT response when recently invalidated fuse_ino_t is received from the kernel (#636) --- lib/fuse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fuse.c b/lib/fuse.c index a95d7c1..f732470 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -1037,7 +1037,7 @@ static int try_get_path(struct fuse *f, fuse_ino_t nodeid, const char *name, for (node = get_node(f, nodeid); node->nodeid != FUSE_ROOT_ID; node = node->parent) { - err = -ENOENT; + err = -ESTALE; if (node->name == NULL || node->parent == NULL) goto out_unlock; @@ -1246,7 +1246,7 @@ static int get_path_nullok(struct fuse *f, fuse_ino_t nodeid, char **path) *path = NULL; } else { err = get_path_common(f, nodeid, NULL, path, NULL); - if (err == -ENOENT) + if (err == -ESTALE) err = 0; } -- cgit v1.2.1 From b08e275083d0316fa4d735d457869d62ce4114de Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 23 Jan 2022 19:17:03 +0900 Subject: Fix ReST end-string nits (#638) This makes the file more readable with syntax highlighting. --- ChangeLog.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 521c163..b97d61d 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -422,7 +422,7 @@ libfuse 3.0.0 (2016-12-08) * The ``-o nopath`` option has been dropped - it never actually did anything (since it is unconditionally overwritten with the value of - the `nopath` flag in `struct fuse_operations). + the `nopath` flag in `struct fuse_operations`). * The ``-o large_read`` mount option has been dropped. Hopefully no one uses a Linux 2.4 kernel anymore. @@ -446,7 +446,7 @@ libfuse 3.0.0 (2016-12-08) * The `fuse_session_new` function no longer accepts the ``-o clone_fd`` option. Instead, this has become a parameter of the - `fuse_session_loop_mt` and ``fuse_loop_mt` functions. + `fuse_session_loop_mt` and `fuse_loop_mt` functions. * For low-level file systems that implement the `write_buf` handler, the `splice_read` option is now enabled by default. As usual, this @@ -636,7 +636,7 @@ libfuse 3.0.0 (2016-12-08) * The *fuse_off_t* and *fuse_ino_t* changed from *unsigned long* to *uint64_t*, i.e. they are now 64 bits also on 32-bit systems. -* The type of the *generation* member of `struct fuse_entry_param* +* The type of the *generation* member of `struct fuse_entry_param*` changed from *unsigned* to *uint64_t*. * The (low-level) `setattr` handler gained a *FUSE_SET_ATTR_CTIME* bit -- cgit v1.2.1 From 5128cee2dd0e54b74e9ea75dfc8cf70a866ee120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 9 Feb 2022 15:59:10 +0100 Subject: Fixed returning an error condition to ioctl(2) (#641) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- ChangeLog.rst | 2 ++ lib/fuse.c | 2 ++ 2 files changed, 4 insertions(+) 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) =========================== diff --git a/lib/fuse.c b/lib/fuse.c index f732470..91a4b70 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -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: -- cgit v1.2.1 From 3c2ba7aa2500618b7b11255ef3f699d6615ad5a2 Mon Sep 17 00:00:00 2001 From: David Galeano Date: Fri, 11 Feb 2022 20:07:00 +0000 Subject: Removed duplicates code. (#642) The cap for FUSE_CAP_WRITEBACK_CACHE was printed twice. --- example/printcap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/example/printcap.c b/example/printcap.c index 472a597..edfd8f5 100644 --- a/example/printcap.c +++ b/example/printcap.c @@ -39,8 +39,6 @@ static void pc_init(void *userdata, printf("Protocol version: %d.%d\n", conn->proto_major, conn->proto_minor); printf("Capabilities:\n"); - if(conn->capable & FUSE_CAP_WRITEBACK_CACHE) - printf("\tFUSE_CAP_WRITEBACK_CACHE\n"); if(conn->capable & FUSE_CAP_ASYNC_READ) printf("\tFUSE_CAP_ASYNC_READ\n"); if(conn->capable & FUSE_CAP_POSIX_LOCKS) -- cgit v1.2.1