linux/fs/f2fs
Jaegeuk Kim 5fd057160a f2fs: assign CURSEG_ALL_DATA_ATGC if blkaddr is valid
[ Upstream commit 8cb1f4080d ]

mkdir /mnt/test/comp
f2fs_io setflags compression /mnt/test/comp
dd if=/dev/zero of=/mnt/test/comp/testfile bs=16k count=1
truncate --size 13 /mnt/test/comp/testfile

In the above scenario, we can get a BUG_ON.
 kernel BUG at fs/f2fs/segment.c:3589!
 Call Trace:
  do_write_page+0x78/0x390 [f2fs]
  f2fs_outplace_write_data+0x62/0xb0 [f2fs]
  f2fs_do_write_data_page+0x275/0x740 [f2fs]
  f2fs_write_single_data_page+0x1dc/0x8f0 [f2fs]
  f2fs_write_multi_pages+0x1e5/0xae0 [f2fs]
  f2fs_write_cache_pages+0xab1/0xc60 [f2fs]
  f2fs_write_data_pages+0x2d8/0x330 [f2fs]
  do_writepages+0xcf/0x270
  __writeback_single_inode+0x44/0x350
  writeback_sb_inodes+0x242/0x530
  __writeback_inodes_wb+0x54/0xf0
  wb_writeback+0x192/0x310
  wb_workfn+0x30d/0x400

The reason is we gave CURSEG_ALL_DATA_ATGC to COMPR_ADDR where the
page was set the gcing flag by set_cluster_dirty().

Cc: stable@vger.kernel.org
Fixes: 4961acdd65 ("f2fs: fix to tag gcing flag on page during block migration")
Reviewed-by: Chao Yu <chao@kernel.org>
Tested-by: Will McVicker <willmcvicker@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-11 12:35:54 +02:00
..
acl.c f2fs: port to vfs{g,u}id_t and associated helpers 2022-10-04 13:31:43 -07:00
acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
checkpoint.c f2fs: fix to update user block counts in block_operations() 2024-08-03 08:49:48 +02:00
compress.c f2fs: fix typos in comments 2024-06-12 11:03:37 +02:00
data.c f2fs: fix typos in comments 2024-06-12 11:03:37 +02:00
debug.c f2fs: refactor extent_cache to support for read and more 2023-05-17 11:53:52 +02:00
dir.c f2fs: convert to use bitmap API 2024-01-10 17:10:30 +01:00
extent_cache.c f2fs: fix typos in comments 2024-06-12 11:03:37 +02:00
f2fs.h f2fs: Add inline to f2fs_build_fault_attr() stub 2024-07-11 12:47:14 +02:00
file.c f2fs: fix to force buffered IO on inline_data inode 2024-08-03 08:49:38 +02:00
gc.c f2fs: fix to add missing iput() in gc_data_segment() 2024-06-12 11:03:42 +02:00
gc.h f2fs: Fix system crash due to lack of free space in LFS 2023-05-24 17:32:38 +01:00
hash.c f2fs: don't use casefolded comparison for "." and ".." 2022-05-17 11:19:23 -07:00
inline.c f2fs: fix return value of f2fs_convert_inline_inode() 2024-08-03 08:49:38 +02:00
inode.c f2fs: fix to don't dirty inode for readonly filesystem 2024-08-03 08:49:38 +02:00
iostat.c f2fs: fix to avoid potential memory corruption in __update_iostat_latency() 2023-03-11 13:55:21 +01:00
iostat.h f2fs: iostat: support accounting compressed IO 2022-08-29 21:15:51 -07:00
Kconfig f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem 2022-03-04 09:15:53 -08:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
namei.c f2fs: fix typos in comments 2024-06-12 11:03:37 +02:00
node.c f2fs: fix to release node block count in error path of f2fs_new_node_page() 2024-06-12 11:03:42 +02:00
node.h f2fs: convert to use bitmap API 2024-01-10 17:10:30 +01:00
recovery.c f2fs: fix to avoid potential panic during recovery 2024-03-26 18:20:55 -04:00
segment.c f2fs: assign CURSEG_ALL_DATA_ATGC if blkaddr is valid 2024-08-11 12:35:54 +02:00
segment.h f2fs: fix start segno of large section 2024-08-03 08:49:48 +02:00
shrinker.c f2fs: refactor extent_cache to support for read and more 2023-05-17 11:53:52 +02:00
super.c f2fs: avoid dead loop in f2fs_issue_checkpoint() 2024-07-27 11:32:18 +02:00
sysfs.c f2fs: check validation of fault attrs in f2fs_build_fault_attr() 2024-07-11 12:47:09 +02:00
verity.c fs: f2fs: initialize fsdata in pagecache_write() 2023-03-11 13:55:18 +01:00
xattr.c f2fs: fix to check return value of f2fs_recover_xattr_data 2024-01-25 15:27:36 -08:00
xattr.h f2fs: code cleanup by removing ifdef macro surrounding 2020-05-26 18:56:10 -07:00