Re: [PATCH for-2.6.33] xfs: flush all log buffers in xlog_dealloc_log

Christoph Hellwig
2010-02-05T11:34:41Z

On Fri, Feb 05, 2010 at 01:58:11PM +1100, Dave Chinner wrote:
> > and there's
> > also a very similar one from Ed Cashin <ecashin@coraid.com> in
> > mail archives from November.
>
> Yeah, that's clearly IO completion after the call to
> xfs_unmountfs_wait(). That does a xfs_wait_buftarg() call
> which waits for all hashed buffers on the buftarg except for
> those that are XBF_FS_MANAGED - the superblock.
>
> Looking at xfs_fs_put_super(), the superblock buffer is freed after
> xfs_unmountfs() frees the log, so if the superblock was logged
> and is undergoing IO then xfs_unmountfs_wait() would not have
> blocked on it and it could leak past the "no more IO should
> bein progress" barrier that xfs_unmountfs_wait() is supposed to
> provide.
>
> Does this look like a plausible cause of the problem?

We just did a xfs_unmountfs_writesb before the call to
xfs_unmountfs_wait, so the superblock buffer should be a sync buffer at
that point, so something more fishy is going on here. syncd is also
stopped before that call, so that gets rid of another possible case
of an async buffer pending.

Independent of that I think xfs_wait_buftarg waiting for the SB buffer
seems correct to me, but I fear something else is going on here.