Re: [PATCH 07/13] xfs: xfs_sync_data is redundant.

Dave Chinner
2012-09-03T06:08:40Z

On Sat, Sep 01, 2012 at 07:24:56PM -0400, Christoph Hellwig wrote:
> On Thu, Aug 30, 2012 at 10:00:11PM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > We don't do any data writeback from XFS any more - the VFS is
> > completely responsible for that, including for freeze. We can
> > replace the remaining caller with the VFS level function that
> > achieves the same thing, but without conflicting with current
> > writeback work - writeback_inodes_sb_if_idle().
> >
> > This means we can remove the flush_work and xfs_flush_inodes() - the
> > VFS functionality completely replaces the internal flush queue for
> > doing this writeback work in a separate context to avoid stack
> > overruns..
>
> Are the lock ordering issues with writeback_inodes_sb_if_idle sorted out
> by now? IIRC it still needs to be switch to a trylock.

It never gets called from unmount or freeze context, so I can't see
how it would deadlock in these use cases. It's only when we call
writeback_inodes_sb_if_idle() from a context that already holds
s_umount that the locking it has matters - that's where btrfs and
ext4 have been getting into trouble with this.

> > - xfs_flush_inodes(ip);
> > + writeback_inodes_sb_if_idle(VFS_I(ip)->i_sb,
> > + WB_REASON_FS_FREE_SPACE);
>
> I'd prefer to still keep a wrapper for an ugly call like this if we can.

OK, I'll add an inline function to do this.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com