xfs: fix buffer flushing during unmount
commit70f589ceb96bbf1d4c2c2f5b6c3d6dff19ddd31d
authorChristoph Hellwig <hch@infradead.org>
Sat, 19 Nov 2011 18:13:43 +0000 (19 13:13 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 26 Nov 2011 17:10:06 +0000 (26 09:10 -0800)
treee14042b00520704f9b244ff722eb713a6a62ec7f
parent5b9d69bca6a43e7cd61df13e820ee4e5f99e1615
xfs: fix buffer flushing during unmount

commit 87c7bec7fc3377b3873eb3a0f4b603981ea16ebb upstream.

The code to flush buffers in the umount code is a bit iffy: we first
flush all delwri buffers out, but then might be able to queue up a
new one when logging the sb counts.  On a normal shutdown that one
would get flushed out when doing the synchronous superblock write in
xfs_unmountfs_writesb, but we skip that one if the filesystem has
been shut down.

Fix this by moving the delwri list flushing until just before unmounting
the log, and while we're at it also remove the superflous delwri list
and buffer lru flusing for the rt and log device that can never have
cached or delwri buffers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Amit Sahrawat <amit.sahrawat83@gmail.com>
Tested-by: Amit Sahrawat <amit.sahrawat83@gmail.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/xfs/linux-2.6/xfs_buf.h
fs/xfs/xfs_mount.c