summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/bio.h
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2023-12-12 15:54:09 +1030
committerDavid Sterba <dsterba@suse.com>2023-12-15 23:03:58 +0100
commitf4521b01c5246b921debc6db6f112f89f94cc61b (patch)
tree11811d40faf1d589e43d37485e3616b6616ca587 /fs/btrfs/bio.h
parenta700ca5ec4ee9c2feb6e56469ce808f9769dc9f3 (diff)
downloadlinux-f4521b01c5246b921debc6db6f112f89f94cc61b.tar.gz
linux-f4521b01c5246b921debc6db6f112f89f94cc61b.tar.bz2
linux-f4521b01c5246b921debc6db6f112f89f94cc61b.zip
btrfs: migrate eb_bitmap_offset() to folio interfaces
[BUG] Test case btrfs/002 would fail if larger folios are enabled for metadata: assertion failed: folio, in fs/btrfs/extent_io.c:4358 ------------[ cut here ]------------ kernel BUG at fs/btrfs/extent_io.c:4358! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 1 PID: 30916 Comm: fsstress Tainted: G OE 6.7.0-rc3-custom+ #128 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 2/2/2022 RIP: 0010:assert_eb_folio_uptodate+0x98/0xe0 [btrfs] Call Trace: <TASK> extent_buffer_test_bit+0x3c/0x70 [btrfs] free_space_test_bit+0xcd/0x140 [btrfs] modify_free_space_bitmap+0x27a/0x430 [btrfs] add_to_free_space_tree+0x8d/0x160 [btrfs] __btrfs_free_extent.isra.0+0xef1/0x13c0 [btrfs] __btrfs_run_delayed_refs+0x786/0x13c0 [btrfs] btrfs_run_delayed_refs+0x33/0x120 [btrfs] btrfs_commit_transaction+0xa2/0x1350 [btrfs] iterate_supers+0x77/0xe0 ksys_sync+0x60/0xa0 __do_sys_sync+0xa/0x20 do_syscall_64+0x3f/0xf0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 </TASK> [CAUSE] The function extent_buffer_test_bit() is not folio compatible. It still assumes the old fixed page size, when an extent buffer with large folio passed in, only eb->folios[0] is populated. Then if the target bit range falls in the 2nd page of the folio, then we would check eb->folios[1], and trigger the ASSERT(). [FIX] Just migrate eb_bitmap_offset() to folio interfaces, using the folio_size() to replace PAGE_SIZE. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/bio.h')
0 files changed, 0 insertions, 0 deletions