Skip to contentSkip to conversation

fuse3: fix ptest test_passthrough_hp failure

PATCH New [email protected] 1 participant 1 message Aug 16, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fuse3: fix ptest test_passthrough_hp failure

From: Changqing Li <[email protected]>

fix test_passthrough_hp failure with error:
21 unlinked testfile checks failed

---
 ...lls.c-allow-EBADF-in-fcheck_stat-631.patch | 45 +++++++++++++++++++
 .../recipes-support/fuse/fuse3_3.10.5.bb      |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta-filesystems/recipes-support/fuse/fuse3/0001-test-test_syscalls.c-allow-EBADF-in-fcheck_stat-631.patch
meta-filesystems/recipes-support/fuse/fuse3/0001-test-test_syscalls.c-allow-EBADF-in-fcheck_stat-631.patch new file +45 -0
new file mode 100644
index 0000000000..2207408bd2
@@ -0,0 +1,45 @@
+From cee6de8d6619aeeb70f3318dfd35f2fdf5e43848 Mon Sep 17 00:00:00 2001
+From: Luis Henriques <[email protected]>
+Date: Sat, 20 Nov 2021 10:09:25 +0000
+Subject: [PATCH] test/test_syscalls.c: allow EBADF in fcheck_stat() (#631)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Test test/test_examples.py::test_passthrough_hp[False] fails because, on
+kernels >= 5.14, fstat() will return -EBADF:
+
+3 [check_unlinked_testfile] fcheck_stat() - fstat: Bad file descriptor
+4 [check_unlinked_testfile] fcheck_stat() - fstat: Bad file descriptor
+5 [check_unlinked_testfile] fcheck_stat() - fstat: Bad file descriptor
+9 [check_unlinked_testfile] fcheck_stat() - fstat: Bad file descriptor
+...
+
+This patch simply whitelists the EBADF errno code.
+
+Signed-off-by: Luís Henriques <[email protected]>
+Co-authored-by: Luís Henriques <[email protected]>
+
+Upstream-Status: Backport [https://github.com/libfuse/libfuse/commit/cee6de8d6619aeeb70f3318dfd35f2fdf5e43848]
+Signed-off-by: Changqing Li <[email protected]>
+---
+ test/test_syscalls.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/test/test_syscalls.c b/test/test_syscalls.c
+index 160a2ac..65292ed 100644
+--- a/test/test_syscalls.c
++++ b/test/test_syscalls.c
+@@ -277,7 +277,8 @@ static int fcheck_stat(int fd, int flags, struct stat *st)
+ 		if (flags & O_PATH) {
+ 			// With O_PATH fd, the server does not have to keep
+ 			// the inode alive so FUSE inode may be stale or bad
+-			if (errno == ESTALE || errno == EIO || errno == ENOENT)
++			if (errno == ESTALE || errno == EIO ||
++			    errno == ENOENT || errno == EBADF)
+ 				return 0;
+ 		}
+ 		PERROR("fstat");
+-- 
+2.25.1
+
meta-filesystems/recipes-support/fuse/fuse3_3.10.5.bb +1 -0
index 8b0d8ecab8..0f379afb92 100644
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://GPL2.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://LICENSE;md5=a55c12a2d7d742ecb41ca9ae0a6ddc66"
 
 SRC_URI = "https://github.com/libfuse/libfuse/releases/download/fuse-${PV}/fuse-${PV}.tar.xz \
+           file://0001-test-test_syscalls.c-allow-EBADF-in-fcheck_stat-631.patch \
 "
 SRC_URI[sha256sum] = "b2e283485d47404ac896dd0bb7f7ba81e1470838e677e45f659804c3a3b69666"
 
Signature · 1 line
2.25.1