diff options
author | Theodore Ts'o <tytso@mit.edu> | 2015-06-20 22:50:33 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-06-20 22:50:33 -0400 |
commit | 89d96a6f8e6491f24fc8f99fd6ae66820e85c6c1 (patch) | |
tree | 3c624725fe289d7e30553401f5bb1fe9e74ca51b | |
parent | 2143c1965a761332ae417b22fd477b636e4f54ec (diff) |
ext4: call sync_blockdev() before invalidate_bdev() in put_super()
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>
Cc: stable@vger.kernel.org
-rw-r--r-- | fs/ext4/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index fdac076e0791..2858ac09f5a3 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -828,6 +828,7 @@ static void ext4_put_super(struct super_block *sb) | |||
828 | dump_orphan_list(sb, sbi); | 828 | dump_orphan_list(sb, sbi); |
829 | J_ASSERT(list_empty(&sbi->s_orphan)); | 829 | J_ASSERT(list_empty(&sbi->s_orphan)); |
830 | 830 | ||
831 | sync_blockdev(sb->s_bdev); | ||
831 | invalidate_bdev(sb->s_bdev); | 832 | invalidate_bdev(sb->s_bdev); |
832 | if (sbi->journal_bdev && sbi->journal_bdev != sb->s_bdev) { | 833 | if (sbi->journal_bdev && sbi->journal_bdev != sb->s_bdev) { |
833 | /* | 834 | /* |