xfs_healer: fix missing HAVE_LISTMOUNT flag and stubs
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.
--- libfrog/statmount.h | 6 ++++-- healer/Makefile | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-)
libfrog/statmount.h +4 -2
@@ -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
@@ -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
Quoted 44 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
xfs/666 regressed with a broken
xfs_healer_startthat can't actually walk the mount namespace with listmount and statmount. The new stubs are wrapped withHAVE_LISTMOUNT, but this cflag is not added in healer/Makefileeven if the build system hasHAVE_LISTMOUNTset.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")Signed-off-by "Darrick J. Wong" <[email protected]>--- libfrog/statmount.h | 6 ++++-- healer/Makefile | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-)libfrog/statmount.h +4
-2@@ -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
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
Looks good: