Re: xfs: stop the sync worker before xfs_unmountfs

Dave Chinner
2012-09-12T23:13:05Z

On Wed, Sep 12, 2012 at 01:33:47PM -0500, Ben Myers wrote:
> See what you think of this. Not heavily tested yet, and not pretty... but it
> is fairly minimal.
....
> Signed-off-by: Ben Myers <bpm@sgi.com>
>
> Index: xfs/fs/xfs/xfs_super.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_super.c
> +++ xfs/fs/xfs/xfs_super.c
> @@ -919,6 +919,7 @@ xfs_fs_put_super(
> struct xfs_mount *mp = XFS_M(sb);
>
> xfs_filestream_unmount(mp);
> + cancel_delayed_work_sync(&mp->m_sync_work);
> xfs_unmountfs(mp);
> xfs_syncd_stop(mp);
> xfs_freesb(mp);

This is the only hunk in the patch needed to fix the problem.

The rest of the patch does not change the order in which the sync
worker is started and stopped - it just open codes it next to the
xfs_syncd_start/stop calls. Essentially, all it does is obfuscate
the real fix that is being made here and makes it harder to
understand what the relationship between xfs_sync_worker() and
xfs_syncd_start/stop is supposed to be.

So a minimal patch, IMO, is just the above hunk....

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com