From a7704e0b56cc5e40ff3b20055be78db20de71927 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 13 Jul 2023 16:59:45 -0400 Subject: [PATCH] Allow the kernel to return -ESTALE from orphan-inode test In newer kernels, we always get -ESTALE because the inode has been marked immediately as deleting. Since this is expected behavior we should not fail the test here on this error value. Signed-off-by: Auke Kok --- tests/src/handle_fsetxattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/handle_fsetxattr.c b/tests/src/handle_fsetxattr.c index 5d063552..b39d7db5 100644 --- a/tests/src/handle_fsetxattr.c +++ b/tests/src/handle_fsetxattr.c @@ -48,7 +48,7 @@ struct our_handle { static void exit_usage(void) { printf(" -h/-? output this usage message and exit\n" - " -e keep trying on enoent, consider success an error\n" + " -e keep trying on enoent and estale, consider success an error\n" " -i 64bit inode number for handle open, can be multiple\n" " -m scoutfs mount path string for ioctl fd\n" " -n optional xattr name string, defaults to \""DEFAULT_NAME"\"\n" @@ -149,7 +149,7 @@ int main(int argc, char **argv) fd = open_by_handle_at(mntfd, &handle.handle, O_RDWR); if (fd == -1) { - if (!enoent_success_err || errno != ENOENT) { + if (!enoent_success_err || ( errno != ENOENT && errno != ESTALE )) { perror("open_by_handle_at"); return 1; }