]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
f2fs: flush bios to handle cp_error in put_super
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 29 Jan 2016 16:57:59 +0000 (08:57 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 23 Feb 2016 00:07:23 +0000 (16:07 -0800)
Sometimes, if cp_error is set, there remains under-writeback pages, resulting in
kernel hang in put_super.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index 58d9a5574bb0d85ddf59c9061b5c7044dbcbcd70..9445a34b8d48c184ecf0762b65dc2096896d2885 100644 (file)
@@ -582,6 +582,13 @@ static void f2fs_put_super(struct super_block *sb)
        f2fs_leave_shrinker(sbi);
        mutex_unlock(&sbi->umount_mutex);
 
+       /* our cp_error case, we can wait for any writeback page */
+       if (get_pages(sbi, F2FS_WRITEBACK)) {
+               f2fs_submit_merged_bio(sbi, DATA, WRITE);
+               f2fs_submit_merged_bio(sbi, NODE, WRITE);
+               f2fs_submit_merged_bio(sbi, META, WRITE);
+       }
+
        iput(sbi->node_inode);
        iput(sbi->meta_inode);