diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2019-09-15 23:06:19 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2019-09-15 23:06:19 -0400 |
commit | 0c0f4f1ffe68f0dd4652ceeb7a2240ebd85ff257 (patch) | |
tree | 0e432e6568664314343c7d0d6e435649044dbb54 | |
parent | ecde345b6de2908154d71fdbcc85e762568bba78 (diff) | |
download | longterm-queue-4.18-0c0f4f1ffe68f0dd4652ceeb7a2240ebd85ff257.tar.gz |
f2fs: drop commit with build issues
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/f2fs-fix-to-avoid-panic-in-dec_valid_block_count.patch | 90 | ||||
-rw-r--r-- | queue/series | 1 |
2 files changed, 0 insertions, 91 deletions
diff --git a/queue/f2fs-fix-to-avoid-panic-in-dec_valid_block_count.patch b/queue/f2fs-fix-to-avoid-panic-in-dec_valid_block_count.patch deleted file mode 100644 index 9749b4f..0000000 --- a/queue/f2fs-fix-to-avoid-panic-in-dec_valid_block_count.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 886678365493d831b9a54b43623f8793c43debe4 Mon Sep 17 00:00:00 2001 -From: Chao Yu <yuchao0@huawei.com> -Date: Mon, 15 Apr 2019 15:28:30 +0800 -Subject: [PATCH] f2fs: fix to avoid panic in dec_valid_block_count() - -commit 5e159cd349bf3a31fb7e35c23a93308eb30f4f71 upstream. - -As Jungyeon reported in bugzilla: - -https://bugzilla.kernel.org/show_bug.cgi?id=203209 - -- Overview -When mounting the attached crafted image and running program, I got this error. -Additionally, it hangs on sync after the this script. - -The image is intentionally fuzzed from a normal f2fs image for testing and I enabled option CONFIG_F2FS_CHECK_FS on. - -- Reproduces -cc poc_01.c -./run.sh f2fs -sync - - kernel BUG at fs/f2fs/f2fs.h:1788! - RIP: 0010:f2fs_truncate_data_blocks_range+0x342/0x350 - Call Trace: - f2fs_truncate_blocks+0x36d/0x3c0 - f2fs_truncate+0x88/0x110 - f2fs_setattr+0x3e1/0x460 - notify_change+0x2da/0x400 - do_truncate+0x6d/0xb0 - do_sys_ftruncate+0xf1/0x160 - do_syscall_64+0x43/0xf0 - entry_SYSCALL_64_after_hwframe+0x44/0xa9 - -The reason is dec_valid_block_count() will trigger kernel panic due to -inconsistent count in between inode.i_blocks and actual block. - -To avoid panic, let's just print debug message and set SBI_NEED_FSCK to -give a hint to fsck for latter repairing. - -Signed-off-by: Chao Yu <yuchao0@huawei.com> -[Jaegeuk Kim: fix build warning and add unlikely] -Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> - -diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h -index 6020fab2f0c9..5b4f9dc644c5 100644 ---- a/fs/f2fs/f2fs.h -+++ b/fs/f2fs/f2fs.h -@@ -1709,6 +1709,7 @@ static inline int inc_valid_block_count(struct f2fs_sb_info *sbi, - return -ENOSPC; - } - -+void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...); - static inline void dec_valid_block_count(struct f2fs_sb_info *sbi, - struct inode *inode, - block_t count) -@@ -1717,13 +1718,21 @@ static inline void dec_valid_block_count(struct f2fs_sb_info *sbi, - - spin_lock(&sbi->stat_lock); - f2fs_bug_on(sbi, sbi->total_valid_block_count < (block_t) count); -- f2fs_bug_on(sbi, inode->i_blocks < sectors); - sbi->total_valid_block_count -= (block_t)count; - if (sbi->reserved_blocks && - sbi->current_reserved_blocks < sbi->reserved_blocks) - sbi->current_reserved_blocks = min(sbi->reserved_blocks, - sbi->current_reserved_blocks + count); - spin_unlock(&sbi->stat_lock); -+ if (unlikely(inode->i_blocks < sectors)) { -+ f2fs_msg(sbi->sb, KERN_WARNING, -+ "Inconsistent i_blocks, ino:%lu, iblocks:%llu, sectors:%llu", -+ inode->i_ino, -+ (unsigned long long)inode->i_blocks, -+ (unsigned long long)sectors); -+ set_sbi_flag(sbi, SBI_NEED_FSCK); -+ return; -+ } - f2fs_i_blocks_write(inode, count, false, true); - } - -@@ -2800,7 +2809,6 @@ void f2fs_quota_off_umount(struct super_block *sb); - int f2fs_commit_super(struct f2fs_sb_info *sbi, bool recover); - int f2fs_sync_fs(struct super_block *sb, int sync); - extern __printf(3, 4) --void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...); - int f2fs_sanity_check_ckpt(struct f2fs_sb_info *sbi); - - /* --- -2.7.4 - diff --git a/queue/series b/queue/series index a54304d..91d95ee 100644 --- a/queue/series +++ b/queue/series @@ -35,7 +35,6 @@ f2fs-fix-to-avoid-panic-in-f2fs_inplace_write_data.patch f2fs-fix-to-avoid-panic-in-f2fs_remove_inode_page.patch f2fs-fix-to-do-sanity-check-on-free-nid.patch f2fs-fix-to-clear-dirty-inode-in-error-path-of-f2fs_.patch -f2fs-fix-to-avoid-panic-in-dec_valid_block_count.patch f2fs-fix-to-use-inline-space-only-if-inline_xattr-is.patch f2fs-fix-to-do-sanity-check-on-valid-block-count-of-.patch percpu-remove-spurious-lock-dependency-between-percp.patch |