Skip to contentSkip to conversation

Disable statx if using glibc emulation

PATCH In review Doug Nazar 2 participants 2 messages Dec 5, 2019 – Dec 9, 2019

Subsystems (2)
lore
Share & tools
lore

Doug Nazar

author
#0 lore raw

PATCH 1/1 Disable statx if using glibc emulation

On older kernels without statx, glibc with statx support will attempt to emulate the call. However it doesn't support AT_STATX_DONT_SYNC and will return EINVAL. This causes all xstat/xlstat calls to fail.

---
 support/misc/xstat.c | 3 +++
 1 file changed, 3 insertions(+)
support/misc/xstat.c +3 -0
index 661e29e4..a438fbcc 100644
@@ -51,6 +51,9 @@ statx_do_stat(int fd, const char *pathname, struct stat *statbuf, int flags)
 			statx_copy(statbuf, &stxbuf);
 			return 0;
 		}
+		/* glibc emulation doesn't support AT_STATX_DONT_SYNC */
+		if (errno == EINVAL)
+			errno = ENOSYS;
 		if (errno == ENOSYS)
 			statx_supported = 0;
 	} else
Signature · 1 line
2.24.0
#1 lore raw
Quoted 5 lines · Doug Nazar

On older kernels without statx, glibc with statx support will attempt to emulate the call. However it doesn't support AT_STATX_DONT_SYNC and will return EINVAL. This causes all xstat/xlstat calls to fail.

Committed... (tag: nfs-utils-2-4-3-rc3)

steved.

Quoted 19 lines
---
 support/misc/xstat.c | 3 +++
 1 file changed, 3 insertions(+)
support/misc/xstat.c +3 -0
index 661e29e4..a438fbcc 100644
@@ -51,6 +51,9 @@ statx_do_stat(int fd, const char *pathname, struct stat *statbuf, int flags)
 			statx_copy(statbuf, &stxbuf);
 			return 0;
 		}
+		/* glibc emulation doesn't support AT_STATX_DONT_SYNC */
+		if (errno == EINVAL)
+			errno = ENOSYS;
 		if (errno == ENOSYS)
 			statx_supported = 0;
 	} else