Re: [PATCH 1/1] xfs_scrub_all: wait for services to start activating

Darrick J. Wong
2024-10-28T16:45:30Z

On Mon, Oct 28, 2024 at 01:44:23AM -0700, Christoph Hellwig wrote:
> On Thu, Oct 24, 2024 at 11:38:27PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > It seems that the function call to start a systemd unit completes
> > asynchronously from any change in that unit's active state. On a
> > lightly loaded system, a Start() call followed by an ActiveState()
> > call actually sees the change in state from inactive to activating.
> >
> > Unfortunately, on a heavily loaded system, the state change may take a
> > few seconds. If this is the case, the wait() call can see that the unit
> > state is "inactive", decide that the service already finished, and exit
> > early, when in reality it hasn't even gotten to 'activating'.
> >
> > Fix this by adding a second method that watches either for the inactive
> > -> activating state transition or for the last exit from inactivation
> > timestamp to change before waiting for the unit to reach inactive state.
> >
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > Cc: <linux-xfs@vger.kernel.org> # v6.10.0
>
> What is this supposed to mean?

It means that if anyone is supporting xfsprogs 6.10, this patch applies
to it.

> The patch itself looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Thanks!

--D