public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: David White <dr.white.nz@gmail.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: xfs_scrub_all.service
Date: Thu, 17 Apr 2025 08:00:04 -0700	[thread overview]
Message-ID: <20250417150004.GP25675@frogsfrogsfrogs> (raw)
In-Reply-To: <CAF9hJQszo5J=5NGuALdQW5iBrx+qB=nY__y3ae=k8P1JgbeUQg@mail.gmail.com>

On Thu, Apr 17, 2025 at 10:35:58AM +0100, David White wrote:
> Hi there,
> 
> I'm on Ubuntu 24.10 which has a secondary mount xfs filesystem.
> 
> I have installed xfsprogs. Which installs a /usr/sbin/xfs_scrub_all
> python script, and a systemd service and timer to run it. xfsprogs
> version 6.8.0 (same on 6.9.0 built from source too)
> 
> However, looking at the code for xfs_scrub_all, it's broken. It fails
> on a non-existent "debug" global, and the run_scrub thread target has
> a call to path_to_serviceunit with a "path" parameter that doesn't
> exist. (I'm assuming this is supposed to be "mnt")

Yes, and both bugs were fixed in 6.10.

> I've disabled this service, (and the timer that runs it) and added it
> to my system presets for future installs not to enable this unit.
> 
> What is going on here? What is the purpose?

xfs_scrub_all schedules xfs_scrub@ services to run background online
fsck of mounted XFS filesystems.  That said, xfs_scrub_all before
xfsprogs 6.10 has some of serious bugs in it (as you note!).  Back in
the 6.8 days days the kernel portion was not yet complete, and the
userspace part didn't fully catch up until late last year.

The strange part is that none of that stuff should be active in the
xfsprogs 6.8 package for Debian or Ubuntu, unless I seriously
misunderstand what this line in debian/rules does:

dh_installsystemd -p xfsprogs --no-enable --no-start --no-restart-after-upgrade --no-stop-on-upgrade

which (AFAIK) installs the units but does not enable or start any of
them.  But I'm guessing it got activated on your system anyway?  From
the postinst script of the package in question:

https://mirrors.edge.kernel.org/ubuntu/pool/main/x/xfsprogs/xfsprogs_6.8.0-2.2ubuntu1_amd64.deb

# Automatically added by dh_installsystemd/13.18ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if deb-systemd-helper debian-installed 'xfs_scrub_all.timer'; then
		# The following line should be removed in trixie or trixie+1
		deb-systemd-helper unmask 'xfs_scrub_all.timer' >/dev/null || true

		if deb-systemd-helper --quiet was-enabled 'xfs_scrub_all.timer'; then
			# Create new symlinks, if any.
			deb-systemd-helper enable 'xfs_scrub_all.timer' >/dev/null || true
		fi
	fi

	# Update the statefile to add new symlinks (if any), which need to be cleaned
	# up on purge. Also remove old symlinks.
	deb-systemd-helper update-state 'xfs_scrub_all.timer' >/dev/null || true
fi

From my reading, this only enables the timer (but doesn't start it!) if
the debian system helper thought it was already enabled.

On a newer 6.13 package, the --no-enable and --no-start flags are gone,
so postinst gets a new block:

# Automatically added by dh_installsystemd/13.11.4
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
        if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ]; then
                systemctl --system daemon-reload >/dev/null || true
                deb-systemd-invoke start 'system-xfs_healer.slice' 'system-xfs_scrub.slice' 'xfs_scrub_all.timer' >/dev/null || true
        fi
fi

which actually starts it.  But this shouldn't have been started up on
your system.

<confused>

--D

> Thanks,
> 
> David.
> 

      reply	other threads:[~2025-04-17 15:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17  9:35 xfs_scrub_all.service David White
2025-04-17 15:00 ` Darrick J. Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250417150004.GP25675@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=dr.white.nz@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox