Skip to contentSkip to conversation

xfs_healer: fix missing HAVE_LISTMOUNT flag and stubs

PATCH In review Darrick J. Wong 3 participants 3 messages May 19

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_healer: fix missing HAVE_LISTMOUNT flag and stubs

From: Darrick J. Wong <[email protected]>

xfs/666 regressed with a broken xfs_healer_start that can't actually walk the mount namespace with listmount and statmount. The new stubs are wrapped with HAVE_LISTMOUNT, but this cflag is not added in healer/ Makefile even if the build system has HAVE_LISTMOUNT set.

Also fix the stubs to return error correctly -- the wrappers follow C library behavior.

Fixes b30356f25335eb ("libfrog: add fallback stubs for libfrog_statmount and fstatmount")
---
 libfrog/statmount.h |    6 ++++--
 healer/Makefile     |    4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)
libfrog/statmount.h +4 -2
index 13aaad3a99dca1..b12e6d52ea5749 100644
@@ -107,12 +107,14 @@ int libfrog_fstatmount(int fd, uint64_t statmount_flags,
 static inline int libfrog_statmount(uint64_t mnt_id, int mnt_ns_fd, uint64_t statmount_flags,
 		struct statmount *smbuf, size_t smbuf_size)
 {
-	return -ENOSYS;
+	errno = ENOSYS;
+	return -1;
 }
 static inline int libfrog_fstatmount(int fd, uint64_t statmount_flags,
 		struct statmount *smbuf, size_t smbuf_size)
 {
-	return -ENOSYS;
+	errno = ENOSYS;
+	return -1;
 }
 #endif
 
healer/Makefile +4 -0
index 19255f6537ae9c..b35e310cf0a220 100644
@@ -21,6 +21,10 @@ xfs_healer.h
 
 CFLAGS+=-DXFS_SCRUB_SVCNAME=\"$(XFS_SCRUB_SVCNAME)\"
 
+ifeq ($(HAVE_LISTMOUNT),yes)
+CFLAGS += -DHAVE_LISTMOUNT
+endif
+
 LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBURCU) $(LIBPTHREAD)
 LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG)
 LLDFLAGS = -static
Reviewed-by on v1 1/1
#1 lore raw
Quoted 44 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

xfs/666 regressed with a broken xfs_healer_start that can't actually walk the mount namespace with listmount and statmount. The new stubs are wrapped with HAVE_LISTMOUNT, but this cflag is not added in healer/ Makefile even if the build system has HAVE_LISTMOUNT set.

Also fix the stubs to return error correctly -- the wrappers follow C library behavior.

Fixes b30356f25335eb ("libfrog: add fallback stubs for libfrog_statmount and fstatmount")
---
 libfrog/statmount.h |    6 ++++--
 healer/Makefile     |    4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)
libfrog/statmount.h +4 -2
index 13aaad3a99dca1..b12e6d52ea5749 100644
@@ -107,12 +107,14 @@ int libfrog_fstatmount(int fd, uint64_t statmount_flags,
 static inline int libfrog_statmount(uint64_t mnt_id, int mnt_ns_fd, uint64_t statmount_flags,
 		struct statmount *smbuf, size_t smbuf_size)
 {
-	return -ENOSYS;
+	errno = ENOSYS;
+	return -1;
 }
 static inline int libfrog_fstatmount(int fd, uint64_t statmount_flags,
 		struct statmount *smbuf, size_t smbuf_size)
 {
-	return -ENOSYS;
+	errno = ENOSYS;
+	return -1;
 }
 #endif
 
healer/Makefile +0 -0
index 19255f6537ae9c..b35e310cf0a220 100644

healer/Makefile xfs_healer.h · line 30

Quoted 10 lines
healer/Makefile +4 -0
@@ -21,6 +21,10 @@ xfs_healer.h
 
 CFLAGS+=-DXFS_SCRUB_SVCNAME=\"$(XFS_SCRUB_SVCNAME)\"
 
+ifeq ($(HAVE_LISTMOUNT),yes)
+CFLAGS += -DHAVE_LISTMOUNT
+endif
+
 LLDLIBS += $(LIBHANDLE) $(LIBFROG) $(LIBURCU) $(LIBPTHREAD)
 LTDEPENDENCIES += $(LIBHANDLE) $(LIBFROG)
 LLDFLAGS = -static

Looks good to me

Signature · 1 line
- Andrey