#1149571 xfs_healer@-.service loaded failed failed Self Healing of XFS Metadata for /

Package:
xfsprogs
Source:
xfsprogs
Description:
Utilities for managing the XFS filesystem
Submitter:
Michael Biebl
Date:
2026-10-19 07:03:02 UTC
Severity:
normal
#1149571#5
Date:
2026-09-30 21:48:32 UTC
From:
To:
Hi,

I have xfsprogs installed but currently no XFS file system that uses
XFS. Since the latest upgrade, I get this failure during boot:


# systemctl status xfs_healer@-.service
× xfs_healer@-.service - Self Healing of XFS Metadata for /
     Loaded: loaded (/usr/lib/systemd/system/xfs_healer@.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2026-09-30 23:43:22 CEST; 49s ago
 Invocation: bfbd0588a5dc4c8cad3eb664e82b0fc1
    Process: 976 ExecCondition=/usr/libexec/xfsprogs/xfs_healer --supported / (code=exited, status=255/EXCEPTION)
   Mem peak: 3.8M
        CPU: 24ms

Sep 30 23:43:22 mars systemd[1]: Starting xfs_healer@-.service - Self Healing of XFS Metadata for /...
Sep 30 23:43:22 mars xfs_healer@-[976]: /: Inappropriate ioctl for device
Sep 30 23:43:22 mars systemd[1]: xfs_healer@-.service: Condition check process exited, code=exited, status=255/EXCEPTION
Sep 30 23:43:22 mars systemd[1]: xfs_healer@-.service: Failed with result 'exit-code'.
Sep 30 23:43:22 mars systemd[1]: Failed to start xfs_healer@-.service - Self Healing of XFS Metadata for /.


Apparently this service was enabled event though I don't used XFS for /.

I think this service should only be enabled if / uses XFS or it should
deal better with the situation where / is not using XFS.

#1149571#10
Date:
2026-10-01 06:23:38 UTC
From:
To:
A Debian user reported that the root filesystem service fails with:

 systemd[1]: Starting xfs_healer@-.service - Self Healing of XFS Metadata for /...
 xfs_healer@-[976]: /: Inappropriate ioctl for device
 systemd[1]: xfs_healer@-.service: Condition check process exited, code=exited, status=255/EXCEPTION
 systemd[1]: xfs_healer@-.service: Failed with result 'exit-code'.
 systemd[1]: Failed to start xfs_healer@-.service - Self Healing of XFS Metadata for /.

when the root filesystem is not XFS.  It's most likely ext4 given
Debian's defaults.  However, the actual service failure here is a result
of the ExecCondition program exiting with 255 instead of EXIT_FAILURE.
EXIT_FAILURE is what we're supposed to return to mean "do not run
service".

Note that xfs_healer@- is always started by systemd (and not
xfs_healer_start) because the root filesystem is usually mounted before
systemd starts.

stracing this program a litle further reveals this:

 # strace -e ioctl /usr/libexec/xfsprogs/xfs_healer --supported /
 ioctl(3, _IOC(_IOC_READ, 0x58, 0x7e, 0x100), 0x7fffb2c5e6a8) = -1 ENOTTY (Inappropriate ioctl for device)
 ioctl(3, _IOC(_IOC_READ, 0x58, 0x7c, 0x70), 0x7fffb2c5e6a8) = -1 ENOTTY (Inappropriate ioctl for device)
 ioctl(3, _IOC(_IOC_READ, 0x58, 0x64, 0x70), 0x7fffb2c5e6a8) = -1 ENOTTY (Inappropriate ioctl for device)
 /: Inappropriate ioctl for device

All three ioctls are XFS_IOC_FSGEOMETRY calls, and they all fail with
ENOTTY because this is an ext4 filesystem.  The fsgeometry call occurs
under xfd_open(), so fix this error by special-casing the error return
handling.

Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149571
Reported-by: Michael Biebl <biebl@debian.org>
Cc: <linux-xfs@vger.kernel.org> # v7.0.0
Cc: 1149571@bugs.debian.org
Fixes: ea178059ff72c3 ("xfs_healer: don't start service if kernel support unavailable")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 healer/xfs_healer.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/healer/xfs_healer.c b/healer/xfs_healer.c
index ec402a78d5d2bf..b71695db05876f 100644
--- a/healer/xfs_healer.c
+++ b/healer/xfs_healer.c
@@ -317,6 +317,16 @@ setup_monitor(

 	ret = xfd_open(&ctx->mnt, ctx->mntpoint, O_RDONLY);
 	if (ret) {
+		if (ret == -ENOTTY) {
+			/*
+			 * If this isn't even an XFS filesystem, the fsgeometry
+			 * call will return ENOTTY.
+			 */
+			fprintf(stderr, "%s: %s\n", ctx->mntpoint,
+ _("XFS health monitoring not supported."));
+			return MON_UNSUPPORTED;
+		}
+
 		perror(ctx->mntpoint);
 		return outcome;
 	}

#1149571#15
Date:
2026-10-01 10:07:28 UTC
From:
To:
This probably should be ret = -xfd_open(...)? (not sure why xfd_open
converts errno to negative but all other users convert it back)

Then, ret == ENOTTY

#1149571#20
Date:
2026-10-01 14:37:00 UTC
From:
To:
Yeah, and the perror() call is incorrect too.  I'll post a second patch
to convert the callsite.

#1149571#25
Date:
2026-10-01 14:50:42 UTC
From:
To:
Hi all,

This bugfix series corrects a couple of problems in xfs_healer that
were found by a Debian user.

v2: fix xfd_open callsite's use of error return values in addition to
    fixing the reported problem, per maintainer

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

With a bit of luck, this should all go splendidly.
Comments and questions are, as always, welcome.

#1149571#30
Date:
2026-10-01 14:51:03 UTC
From:
To:
A Debian user reported that the root filesystem service fails with:

 systemd[1]: Starting xfs_healer@-.service - Self Healing of XFS Metadata for /...
 xfs_healer@-[976]: /: Inappropriate ioctl for device
 systemd[1]: xfs_healer@-.service: Condition check process exited, code=exited, status=255/EXCEPTION
 systemd[1]: xfs_healer@-.service: Failed with result 'exit-code'.
 systemd[1]: Failed to start xfs_healer@-.service - Self Healing of XFS Metadata for /.

when the root filesystem is not XFS.  It's most likely ext4 given
Debian's defaults.  However, the actual service failure here is a result
of the ExecCondition program exiting with 255 instead of EXIT_FAILURE.
EXIT_FAILURE is what we're supposed to return to mean "do not run
service".

Note that xfs_healer@- is always started by systemd (and not
xfs_healer_start) because the root filesystem is usually mounted before
systemd starts.

stracing this program a litle further reveals this:

 # strace -e ioctl /usr/libexec/xfsprogs/xfs_healer --supported /
 ioctl(3, _IOC(_IOC_READ, 0x58, 0x7e, 0x100), 0x7fffb2c5e6a8) = -1 ENOTTY (Inappropriate ioctl for device)
 ioctl(3, _IOC(_IOC_READ, 0x58, 0x7c, 0x70), 0x7fffb2c5e6a8) = -1 ENOTTY (Inappropriate ioctl for device)
 ioctl(3, _IOC(_IOC_READ, 0x58, 0x64, 0x70), 0x7fffb2c5e6a8) = -1 ENOTTY (Inappropriate ioctl for device)
 /: Inappropriate ioctl for device

All three ioctls are XFS_IOC_FSGEOMETRY calls, and they all fail with
ENOTTY because this is an ext4 filesystem.  The fsgeometry call occurs
under xfd_open(), so fix this error by special-casing the error return
handling.

Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149571
Reported-by: Michael Biebl <biebl@debian.org>
Cc: <linux-xfs@vger.kernel.org> # v7.0.0
Cc: 1149571@bugs.debian.org
Fixes: bf8b99270c6be1 ("xfs_healer: use the autofsck fsproperty to select mode")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 healer/xfs_healer.c |   10 ++++++++++
 1 file changed, 10 insertions(+)


diff --git a/healer/xfs_healer.c b/healer/xfs_healer.c
index 8fa58b742aea49..0a55e3b5755056 100644
--- a/healer/xfs_healer.c
+++ b/healer/xfs_healer.c
@@ -317,6 +317,16 @@ setup_monitor(

 	ret = -xfd_open(&ctx->mnt, ctx->mntpoint, O_RDONLY);
 	if (ret) {
+		if (ret == ENOTTY) {
+			/*
+			 * If the fsgeometry call returns ENOTTY, this isn't
+			 * even an XFS filesystem.
+			 */
+			fprintf(stderr, "%s: %s\n", ctx->mntpoint,
+ _("XFS health monitoring not supported."));
+			return MON_UNSUPPORTED;
+		}
+
 		fprintf(stderr, "%s: %s\n", ctx->mntpoint, strerror(ret));
 		return outcome;
 	}

#1149571#35
Date:
2026-10-01 16:30:17 UTC
From:
To:
Am 01.10.26 um 08:23 schrieb Darrick J. Wong:

Fwiw, this assumption is correct. My / is using ext4.

Regards,
Michael

#1149571#40
Date:
2026-10-02 08:56:58 UTC
From:
To:
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
#1149571#45
Date:
2026-10-05 17:22:13 UTC
From:
To:
Hi folks,

The xfsprogs for-next branch in repository at:

	git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

has just been updated.

Patches often get missed, so if your outstanding patches are properly reviewed
on the list and not included in this update, please let me know.

The new head of the for-next branch is commit:

caca7f14b449c94583a263e5d4e51354e86529f8

New commits:

Christoph Hellwig (10):
      [8a4a368b497d] libxfs: refactor the reinit case in libxfs_buftarg_init
      [08c91516ffa7] libxfs: split error injection option parsing out of libxfs_buftarg_init
      [8f9506e2dafc] libxfs: remove buftarg member aliases
      [35e136a42548] libxfs: unify buftarg handling with the kernel
      [55ec0ef299d5] libxfs: make the size check in rtmount_init internal RT device aware
      [c189d771732e] libxfs: don't clear ->dev in libxfs_device_close
      [45c2b2ae6968] libxfs: fix buftarg initialization for the RT device
      [d69aadab419e] libxfs: rename bt_bdev*
      [5f82a09e37bc] libfrog: improve ramdisk handling in platform_flush_device
      [e58810a53900] xfs_db: remove a double-whitespace in rdump_regfile_data

Darrick J. Wong (2):
      [d28edf8b3722] xfs_healer: correct xfd_ API usage
      [fde1eeed253a] xfs_healer: fail earlier on non-xfs filesystems

Eric Sandeen (3):
      [196c46c1bd31] libxfs: change cache_node_allocate function signature
      [92d45f837671] libxfs: Return -ENOMEM on actual cache node allocation failures
      [caca7f14b449] libxfs: do not allow cache growth to overflow

Code Diffstat:

 copy/xfs_copy.c          |   2 +-
 db/io.c                  |   4 +-
 db/metadump.c            |   7 +--
 db/rdump.c               |   2 +-
 healer/xfs_healer.c      |  14 ++++-
 libfrog/linux.c          |  13 ++--
 libfrog/platform.h       |   2 +-
 libxfs/buf_mem.c         |   4 +-
 libxfs/cache.c           |  54 ++++++++++++----
 libxfs/init.c            | 161 +++++++++++++++++++++++++----------------------
 libxfs/libxfs_io.h       |   4 +-
 libxfs/rdwr.c            |  50 ++++++++-------
 libxfs/stubs/xfs_mount.h |   3 -
 libxfs/trans.c           |   4 +-
 libxfs/util.c            |   2 +-
 mkfs/xfs_mkfs.c          |  10 ++-
 repair/attr_repair.c     |  11 ++--
 repair/da_util.c         |   2 +-
 repair/dino_chunks.c     |   8 +--
 repair/dinode.c          |   8 +--
 repair/phase3.c          |   2 +-
 repair/phase5.c          |   6 +-
 repair/prefetch.c        |   6 +-
 repair/quotacheck.c      |   2 +-
 repair/rt.c              |   2 +-
 repair/scan.c            |  16 ++---
 repair/zoned.c           |   2 +-
 27 files changed, 228 insertions(+), 173 deletions(-)

#1149571#50
Date:
2026-10-19 07:01:45 UTC
From:
To:
Hi folks,

The xfsprogs master branch in repository at:

	git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

has just been updated.

This release fixes xfs_healer service failing for non-xfs / root. The xfs_scrub
services are now stopped on the filesystem unmount, previously these services
kept mount reference preventing umount. The bug in xfs_repair attempting to
repair a rtdev device which is not actually rtdev was fixed. xfs_io's aginfo
command now reports writepointer block offset for realtime/zoned devices. The
mkfs.xfs defaults= and cli quota options now correctly disables quota in the
case when defaults= has quota enabled but cli options disables them. The rest is
internal clean-ups and bugfixes.

Patches often get missed, so if your outstanding patches are properly reviewed
on the list and not included in this update, please let me know.

The for-next branch has also been updated to match the state of master.

The new head of the master branch is commit:

5b1b80646faa2c3329e6117c3c8a2641091c4519

New commits:

Andrey Albershteyn (1):
      [5b1b80646faa] xfsprogs: Release v7.2.1

Christoph Hellwig (24):
      [d67bdf8007b6] man: fix alignment of the rtstart field in ioctl_xfs_fsgeometry.2
      [8a4a368b497d] libxfs: refactor the reinit case in libxfs_buftarg_init
      [08c91516ffa7] libxfs: split error injection option parsing out of libxfs_buftarg_init
      [8f9506e2dafc] libxfs: remove buftarg member aliases
      [35e136a42548] libxfs: unify buftarg handling with the kernel
      [55ec0ef299d5] libxfs: make the size check in rtmount_init internal RT device aware
      [c189d771732e] libxfs: don't clear ->dev in libxfs_device_close
      [45c2b2ae6968] libxfs: fix buftarg initialization for the RT device
      [d69aadab419e] libxfs: rename bt_bdev*
      [5f82a09e37bc] libfrog: improve ramdisk handling in platform_flush_device
      [e58810a53900] xfs_db: remove a double-whitespace in rdump_regfile_data
      [9c2eaf73c5c2] libxfs: use libxfs.h in xfs_platform.h
      [33ac6b04db36] libxfs: provide memalloc_nofs_{save,restore} stubs
      [9eff420fe37f] libxfs: remove a spurious xfs_rtbitmap.h include in xfs_sb.c
      [4f91e3833ef1] libxfs: move the xfs_rtbitmap.h include in xfs_bmap.c
      [d4eae695d6fa] libxfs: remove the unused xfs_log_item.li_mountp field
      [02cc96ba6bd3] libxfs: remove the unused xfs_inode_log_item.ili_fsync_fields field
      [d6af7a826718] libxfs: remove the xfs_log_item_t and xfs_buf_log_item_t typedefs
      [54b8f286f080] libxfs: remove libxfs_trans_alloc_rollable
      [7d413dd9c5f2] libxfs: return int from xfs_buf_item_init
      [31d51bd0c487] libxfs: use xfs_buf_item.h and xfs_inode_item.h from the kernel source
      [7e217148b3eb] libxfs: cleanup xfs_trans.h
      [fa19604607c1] libxfs: use xfs_trans.h from the kernel source
      [809419124ced] libxfs: use all log item headers from the kernel

Darrick J. Wong (7):
      [a594f085447f] xfs_scrub: terminate systemd services if the sysadmin unmounts
      [73662a3e91d4] mkfs: allow disabling quota flags
      [f2e443ce2107] xfs_quota: fix XFS_GETQSTAT parameter pointer
      [d28edf8b3722] xfs_healer: correct xfd_ API usage
      [fde1eeed253a] xfs_healer: fail earlier on non-xfs filesystems
      [6c62ff9b47e9] misc: convert as many xfsquotactl callsites to xfrog_quotactl as possible
      [989686ca4e74] quotactl: deploy typechecked helpers

Eric Sandeen (3):
      [196c46c1bd31] libxfs: change cache_node_allocate function signature
      [92d45f837671] libxfs: Return -ENOMEM on actual cache node allocation failures
      [caca7f14b449] libxfs: do not allow cache growth to overflow

Wilfred Mallawa (2):
      [bc84c74ae73d] xfs_io: report rg_writepointer in report rg_info()
      [bf0ec1d8a2b6] man/xfs_rtgroup_geometry: add rg_writepointer field description

Code Diffstat:

 VERSION                                  |   2 +-
 configure.ac                             |   2 +-
 copy/xfs_copy.c                          |   2 +-
 db/io.c                                  |   4 +-
 db/logformat.c                           |   4 +
 db/metadump.c                            |   7 +-
 db/rdump.c                               |   2 +-
 debian/changelog                         |   6 +
 doc/CHANGES                              |  10 ++
 healer/xfs_healer.c                      |  14 +-
 include/atomic.h                         |   1 +
 include/libxfs.h                         |   4 +-
 io/aginfo.c                              |   3 +
 libfrog/linux.c                          |  13 +-
 libfrog/platform.h                       |   2 +-
 libfrog/quotactl.h                       |  60 +++++++
 libxfs/Makefile                          |  18 +-
 libxfs/buf_mem.c                         |   5 +-
 libxfs/cache.c                           |  54 ++++--
 libxfs/defer_item.c                      |   3 +-
 libxfs/defer_item.h                      |  56 ------
 libxfs/init.c                            | 163 ++++++++++--------
 libxfs/inode.c                           |   1 +
 libxfs/iunlink.c                         |  10 +-
 libxfs/libxfs_api_defs.h                 |   1 +
 libxfs/libxfs_io.h                       |   4 +-
 libxfs/logitem.c                         |  19 ++-
 libxfs/rdwr.c                            |  50 +++---
 libxfs/stubs/xfs_inode.h                 |   8 +
 libxfs/stubs/xfs_log.h                   |   7 +
 libxfs/stubs/xfs_mount.h                 |   3 -
 libxfs/stubs/xfs_trans.h                 | 167 ------------------
 libxfs/stubs/xfs_trans_priv.h            |  16 ++
 libxfs/trans.c                           |  68 +++++---
 libxfs/util.c                            |   3 +-
 libxfs/xfs_alloc.c                       |   4 +-
 libxfs/xfs_attr.c                        |   2 +-
 libxfs/xfs_attr_item.h                   |  64 +++++++
 libxfs/xfs_attr_leaf.c                   |   2 +
 libxfs/xfs_bmap.c                        |   5 +-
 libxfs/xfs_bmap_item.h                   |  78 +++++++++
 libxfs/xfs_btree.c                       |   2 +
 libxfs/xfs_btree_mem.c                   |   1 +
 libxfs/xfs_buf_item.h                    |  71 ++++++++
 libxfs/xfs_da_btree.c                    |   2 +
 libxfs/xfs_defer.c                       |   4 +
 libxfs/xfs_dir2_block.c                  |   2 +
 libxfs/xfs_dir2_data.c                   |   2 +
 libxfs/xfs_dir2_leaf.c                   |   1 +
 libxfs/xfs_dir2_node.c                   |   2 +
 libxfs/xfs_exchmaps.c                    |   2 +-
 libxfs/xfs_exchmaps_item.h               |  64 +++++++
 libxfs/xfs_extfree_item.h                | 100 +++++++++++
 libxfs/xfs_ialloc.c                      |   3 +
 libxfs/xfs_icreate_item.h                |  22 +++
 libxfs/xfs_inode_fork.c                  |   1 +
 libxfs/xfs_inode_item.h                  |  62 +++++++
 libxfs/xfs_inode_util.c                  |   3 +-
 libxfs/{iunlink.h => xfs_iunlink_item.h} |  17 +-
 libxfs/xfs_parent.c                      |   2 +-
 libxfs/xfs_platform.h                    |  57 +------
 libxfs/xfs_refcount.c                    |   2 +-
 libxfs/xfs_refcount_item.h               |  82 +++++++++
 libxfs/xfs_rmap.c                        |   2 +-
 libxfs/xfs_rmap_item.h                   |  81 +++++++++
 libxfs/xfs_rtbitmap.c                    |   2 +
 libxfs/xfs_rtgroup.c                     |   1 +
 libxfs/xfs_sb.c                          |   3 +-
 libxfs/xfs_symlink_remote.c              |   2 +
 libxfs/xfs_trans.h                       | 283 +++++++++++++++++++++++++++++++
 libxfs/xfs_trans_inode.c                 |   3 +-
 libxfs/xfs_trans_resv.c                  |   8 +-
 man/man2/ioctl_xfs_fsgeometry.2          |   2 +-
 man/man2/ioctl_xfs_rtgroup_geometry.2    |   8 +-
 mkfs/proto.c                             |   8 +-
 mkfs/xfs_mkfs.c                          |  55 +++---
 quota/edit.c                             |  84 ++++-----
 quota/free.c                             |   6 +-
 quota/path.c                             |   2 +-
 quota/quota.c                            |   4 +-
 quota/report.c                           |  22 +--
 quota/state.c                            |  12 +-
 repair/attr_repair.c                     |  11 +-
 repair/da_util.c                         |   2 +-
 repair/dino_chunks.c                     |   8 +-
 repair/dinode.c                          |   8 +-
 repair/phase2.c                          |   1 +
 repair/phase3.c                          |   2 +-
 repair/phase5.c                          |   9 +-
 repair/phase6.c                          |   3 +-
 repair/prefetch.c                        |   6 +-
 repair/quotacheck.c                      |   2 +-
 repair/rmap.c                            |   5 +-
 repair/rt.c                              |   2 +-
 repair/scan.c                            |  16 +-
 repair/zoned.c                           |   2 +-
 scrub/xfs_scrub@.service.in              |   3 +
 scrub/xfs_scrub_media@.service.in        |   3 +
 spaceman/info.c                          |  15 +-
 99 files changed, 1521 insertions(+), 616 deletions(-)
 delete mode 100644 libxfs/defer_item.h
 create mode 100644 libxfs/stubs/xfs_log.h
 delete mode 100644 libxfs/stubs/xfs_trans.h
 create mode 100644 libxfs/stubs/xfs_trans_priv.h
 create mode 100644 libxfs/xfs_attr_item.h
 create mode 100644 libxfs/xfs_bmap_item.h
 create mode 100644 libxfs/xfs_buf_item.h
 create mode 100644 libxfs/xfs_exchmaps_item.h
 create mode 100644 libxfs/xfs_extfree_item.h
 create mode 100644 libxfs/xfs_icreate_item.h
 create mode 100644 libxfs/xfs_inode_item.h
 rename libxfs/{iunlink.h => xfs_iunlink_item.h} (61%)
 create mode 100644 libxfs/xfs_refcount_item.h
 create mode 100644 libxfs/xfs_rmap_item.h
 create mode 100644 libxfs/xfs_trans.h