ext4: call sync_blockdev() before invalidate_bdev() in put_super()
authorTheodore Ts'o <tytso@mit.edu>
Sun, 21 Jun 2015 02:50:33 +0000 (22:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:42 +0000 (09:29 -0700)
commitb9f1b63992150821ef4f28e009bc342325891ef5
tree225ef0259000805025efe282d48022d5f577dde6
parent5831539713c12f187ec132e8eacf86b832c0c94b
ext4: call sync_blockdev() before invalidate_bdev() in put_super()

commit 89d96a6f8e6491f24fc8f99fd6ae66820e85c6c1 upstream.

Normally all of the buffers will have been forced out to disk before
we call invalidate_bdev(), but there will be some cases, where a file
system operation was aborted due to an ext4_error(), where there may
still be some dirty buffers in the buffer cache for the device.  So
try to force them out to memory before calling invalidate_bdev().

This fixes a warning triggered by generic/081:

WARNING: CPU: 1 PID: 3473 at /usr/projects/linux/ext4/fs/block_dev.c:56 __blkdev_put+0xb5/0x16f()

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/super.c