Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89d96a6

Browse files
committed
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 <[email protected]> Cc: [email protected]
1 parent 2143c19 commit 89d96a6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ext4/super.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ static void ext4_put_super(struct super_block *sb)
828828
dump_orphan_list(sb, sbi);
829829
J_ASSERT(list_empty(&sbi->s_orphan));
830830

831+
sync_blockdev(sb->s_bdev);
831832
invalidate_bdev(sb->s_bdev);
832833
if (sbi->journal_bdev && sbi->journal_bdev != sb->s_bdev) {
833834
/*

0 commit comments

Comments
 (0)