ci2 starts bisection 2023-01-22 08:52:21.506977914 +0000 UTC m=+116108.355618377 bisecting cause commit starting from f883675bf6522b52cd75dc3de791680375961769 building syzkaller on cc0f9968db1abe397e6c93bf4f5dff51be20f914 ensuring issue is reproducible on original commit f883675bf6522b52cd75dc3de791680375961769 testing commit f883675bf6522b52cd75dc3de791680375961769 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 24b7be0ca670f1e5191f8279081af2feeb14b906e45967576c034951c8994409 all runs: crashed: kernel BUG in btrfs_csum_one_bio testing release v6.1 testing commit 830b3c68c1fb1e9176028d02ef86f3cf76aa2476 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: a1b9da0661f619159822c3202972a832aacc41ded800ed6be8e4844abae160a3 all runs: OK # git bisect start f883675bf6522b52cd75dc3de791680375961769 830b3c68c1fb1e9176028d02ef86f3cf76aa2476 Bisecting: 8391 revisions left to test after this (roughly 13 steps) [1ca06f1c1acecbe02124f14a37cce347b8c1a90c] Merge tag 'xtensa-20221213' of https://github.com/jcmvbkbc/linux-xtensa testing commit 1ca06f1c1acecbe02124f14a37cce347b8c1a90c gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: ba3cc4e5c6f1e27f796cf350d85c9f57240b30f930d41cedb370faa7a16cdc01 all runs: crashed: kernel BUG in btrfs_csum_one_bio # git bisect bad 1ca06f1c1acecbe02124f14a37cce347b8c1a90c Bisecting: 3754 revisions left to test after this (roughly 12 steps) [8715c6d3100fc7c6edddf29af4a399a1c12d028c] Merge tag 'for-6.2/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm testing commit 8715c6d3100fc7c6edddf29af4a399a1c12d028c gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f296093a8602fa46879b56483b20fb085189ba93d7df040250bdeb34dfc76fc1 all runs: crashed: kernel BUG in btrfs_csum_one_bio # git bisect bad 8715c6d3100fc7c6edddf29af4a399a1c12d028c Bisecting: 1840 revisions left to test after this (roughly 11 steps) [f10bc40168032962ebee26894bdbdc972cde35bf] Merge tag 'core-debugobjects-2022-12-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip testing commit f10bc40168032962ebee26894bdbdc972cde35bf gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 145a73a7e58dd38d7908924c41918f3c2f7e4dae0b3fe6298a5b4dbfd99b4c31 all runs: OK # git bisect good f10bc40168032962ebee26894bdbdc972cde35bf Bisecting: 918 revisions left to test after this (roughly 10 steps) [cf619f891971bfac659ac64968f8c35db605c884] Merge tag 'fs.ovl.setgid.v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping testing commit cf619f891971bfac659ac64968f8c35db605c884 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f5672761dbf180fb706312688ed420eae4c9f841b9833b58fe4d5d18abe51fc6 all runs: OK # git bisect good cf619f891971bfac659ac64968f8c35db605c884 Bisecting: 480 revisions left to test after this (roughly 9 steps) [149c51f876322d9bfbd5e2d6ffae7aff3d794384] Merge tag 'for-6.2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux testing commit 149c51f876322d9bfbd5e2d6ffae7aff3d794384 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 47a0d35f2d0c396a4c55783f2701a0856d366c95f6994986a8a00c1371666719 all runs: crashed: kernel BUG in btrfs_csum_one_bio # git bisect bad 149c51f876322d9bfbd5e2d6ffae7aff3d794384 Bisecting: 218 revisions left to test after this (roughly 8 steps) [3c32c7212f1639471ec0197ff1179b8ef2e0f3d3] btrfs: use cached state when looking for delalloc ranges with lseek testing commit 3c32c7212f1639471ec0197ff1179b8ef2e0f3d3 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 79421ea8f5f5e1e18edfd4c0785eae58853993dc14d049ee55882e0c784b3f56 all runs: crashed: kernel BUG in btrfs_csum_one_bio # git bisect bad 3c32c7212f1639471ec0197ff1179b8ef2e0f3d3 Bisecting: 109 revisions left to test after this (roughly 7 steps) [7c8ede16280586c72c36af6604985d714b84a32c] btrfs: move file-item prototypes into their own header testing commit 7c8ede16280586c72c36af6604985d714b84a32c gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: e48ad024919c03d35a40325b4c419a045244128099033bda295a2270ec7fcdeb all runs: OK # git bisect good 7c8ede16280586c72c36af6604985d714b84a32c Bisecting: 54 revisions left to test after this (roughly 6 steps) [19af6a7d345acc885f970d57577fa80ca4ad3d98] btrfs: change how repair action is passed to btrfs_repair_one_sector testing commit 19af6a7d345acc885f970d57577fa80ca4ad3d98 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: eb08b725d215c6d595080b890f0711e9896f88172482fd3e315e0675cb2bbea3 all runs: OK # git bisect good 19af6a7d345acc885f970d57577fa80ca4ad3d98 Bisecting: 27 revisions left to test after this (roughly 5 steps) [2454151cdede9f6f3a2213ae84b07d9a9edb485e] btrfs: pass btrfs_inode to btrfs_merge_delalloc_extent testing commit 2454151cdede9f6f3a2213ae84b07d9a9edb485e gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f5a2fa6e9f75f64a405f40c6e523dd7ca9290bac81f57cb081ceb3a1edef2c61 all runs: OK # git bisect good 2454151cdede9f6f3a2213ae84b07d9a9edb485e Bisecting: 13 revisions left to test after this (roughly 4 steps) [75b47033296595efb208cc563cbb8cf4fb7c3ebc] btrfs: raid56: migrate recovery and scrub recovery path to use error_bitmap testing commit 75b47033296595efb208cc563cbb8cf4fb7c3ebc gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 55ed1be37393f7b8c8a25c25de4b39feb40845b1401228b3ec606c73d897e93c all runs: OK # git bisect good 75b47033296595efb208cc563cbb8cf4fb7c3ebc Bisecting: 6 revisions left to test after this (roughly 3 steps) [40daf3e095dbd1059d7e600d27e5bb987f563561] btrfs: add an early exit when searching for delalloc range for lseek/fiemap testing commit 40daf3e095dbd1059d7e600d27e5bb987f563561 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 38829f783b2573b64cec65f8648b63cd9b6f513612a36d17fe08432bbeccd0b4 all runs: crashed: kernel BUG in btrfs_csum_one_bio # git bisect bad 40daf3e095dbd1059d7e600d27e5bb987f563561 Bisecting: 3 revisions left to test after this (roughly 2 steps) [bb21e30260a672172a26ee1626dc1463215cf18c] btrfs: move device->name RCU allocation and assign to btrfs_alloc_device() testing commit bb21e30260a672172a26ee1626dc1463215cf18c gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: de1d24c4e8acccd57d7bc2a1a1268da53f3b746e76f97368c7d0f8f666b39ec9 all runs: OK # git bisect good bb21e30260a672172a26ee1626dc1463215cf18c Bisecting: 1 revision left to test after this (roughly 1 step) [947a629988f191807d2d22ba63ae18259bb645c5] btrfs: move tree block parentness check into validate_extent_buffer() testing commit 947a629988f191807d2d22ba63ae18259bb645c5 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 2a3d78404a9566ad632d87f2e3e823ce43ea01399566b3fa36e8e3174fd3f06c all runs: OK # git bisect good 947a629988f191807d2d22ba63ae18259bb645c5 Bisecting: 0 revisions left to test after this (roughly 0 steps) [2c8f5e8cdf0f77670b1a9f72156ad4e82ed323d1] btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree testing commit 2c8f5e8cdf0f77670b1a9f72156ad4e82ed323d1 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c34e4382ac6656bf3258c6e2d30cbbcac9d292e2a77d99d2cba79784903c834e all runs: crashed: kernel BUG in btrfs_csum_one_bio # git bisect bad 2c8f5e8cdf0f77670b1a9f72156ad4e82ed323d1 2c8f5e8cdf0f77670b1a9f72156ad4e82ed323d1 is the first bad commit commit 2c8f5e8cdf0f77670b1a9f72156ad4e82ed323d1 Author: Filipe Manana Date: Fri Nov 11 11:50:27 2022 +0000 btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree We don't need to set the EXTENT_UPDATE bit in an inode's io_tree to mark a range as uptodate, we rely on the pages themselves being uptodate - page reading is not triggered for already uptodate pages. Recently we removed most use of the EXTENT_UPTODATE for buffered IO with commit 52b029f42751 ("btrfs: remove unnecessary EXTENT_UPTODATE state in buffered I/O path"), but there were a few leftovers, namely when reading from holes and successfully finishing read repair. These leftovers are unnecessarily making an inode's tree larger and deeper, slowing down searches on it. So remove all the leftovers. This change is part of a patchset that has the goal to make performance better for applications that use lseek's SEEK_HOLE and SEEK_DATA modes to iterate over the extents of a file. Two examples are the cp program from coreutils 9.0+ and the tar program (when using its --sparse / -S option). A sample test and results are listed in the changelog of the last patch in the series: 1/9 btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree 2/9 btrfs: add an early exit when searching for delalloc range for lseek/fiemap 3/9 btrfs: skip unnecessary delalloc searches during lseek/fiemap 4/9 btrfs: search for delalloc more efficiently during lseek/fiemap 5/9 btrfs: remove no longer used btrfs_next_extent_map() 6/9 btrfs: allow passing a cached state record to count_range_bits() 7/9 btrfs: update stale comment for count_range_bits() 8/9 btrfs: use cached state when looking for delalloc ranges with fiemap 9/9 btrfs: use cached state when looking for delalloc ranges with lseek Reported-by: Wang Yugui Link: https://lore.kernel.org/linux-btrfs/20221106073028.71F9.409509F4@e16-tech.com/ Link: https://lore.kernel.org/linux-btrfs/CAL3q7H5NSVicm7nYBJ7x8fFkDpno8z3PYt5aPU43Bajc1H0h1Q@mail.gmail.com/ Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/extent-io-tree.h | 7 ------- fs/btrfs/extent_io.c | 19 +++---------------- 2 files changed, 3 insertions(+), 23 deletions(-) culprit signature: c34e4382ac6656bf3258c6e2d30cbbcac9d292e2a77d99d2cba79784903c834e parent signature: 2a3d78404a9566ad632d87f2e3e823ce43ea01399566b3fa36e8e3174fd3f06c revisions tested: 16, total time: 6h4m46.479735281s (build: 3h49m37.493295569s, test: 2h5m34.80888529s) first bad commit: 2c8f5e8cdf0f77670b1a9f72156ad4e82ed323d1 btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree recipients (to): ["clm@fb.com" "dsterba@suse.com" "dsterba@suse.com" "fdmanana@suse.com" "josef@toxicpanda.com" "linux-btrfs@vger.kernel.org"] recipients (cc): ["linux-kernel@vger.kernel.org"] crash: kernel BUG in btrfs_csum_one_bio R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fffbec60d0f R14: 00007f33488b4300 R15: 0000000000022000 ------------[ cut here ]------------ kernel BUG at fs/btrfs/file-item.c:724! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 5265 Comm: syz-executor.0 Not tainted 6.1.0-rc8-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 RIP: 0010:btrfs_csum_one_bio+0x1010/0x1060 fs/btrfs/file-item.c:724 Code: e1 07 80 c1 03 38 c1 0f 8c a4 f3 ff ff 48 89 df e8 e5 a5 8e fe 48 8b 54 24 50 4c 8d 8c 24 20 01 00 00 4d 89 e0 e9 87 f3 ff ff <0f> 0b 44 89 f1 80 e1 07 38 c1 0f 8c fd fd ff ff be 08 00 00 00 4c RSP: 0018:ffffc9000ad67160 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000400140 RCX: 00000000fffbffff RDX: 0000000000000000 RSI: 1ffff1100ee99afd RDI: ffff8880774cd7ec RBP: ffffc9000ad67498 R08: 0000000000000dc0 R09: 00000000ffffffff R10: fffffbfff183f93b R11: 1ffffffff183f93a R12: 000000000000f000 R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000 FS: 00007f33488b4700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020010000 CR3: 000000001bae4000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btrfs_submit_data_write_bio+0x282/0x3f0 fs/btrfs/inode.c:2756 submit_one_bio+0x1f6/0x330 fs/btrfs/extent_io.c:139 submit_write_bio fs/btrfs/extent_io.c:164 [inline] extent_writepages+0x29d/0x4a0 fs/btrfs/extent_io.c:3302 do_writepages+0x33e/0x5c0 mm/page-writeback.c:2469 filemap_fdatawrite_wbc+0xdb/0x130 mm/filemap.c:388 __filemap_fdatawrite_range mm/filemap.c:421 [inline] filemap_fdatawrite_range+0x170/0x200 mm/filemap.c:439 btrfs_fdatawrite_range fs/btrfs/file.c:3855 [inline] start_ordered_ops fs/btrfs/file.c:1729 [inline] btrfs_sync_file+0x3b0/0xed0 fs/btrfs/file.c:1805 generic_write_sync include/linux/fs.h:2891 [inline] btrfs_do_write_iter+0xa6a/0xe90 fs/btrfs/file.c:1678 call_write_iter include/linux/fs.h:2199 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7b2/0xb00 fs/read_write.c:584 ksys_write+0x11d/0x200 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f3347a8c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f33488b4168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f3347babf80 RCX: 00007f3347a8c0c9 RDX: 000000000000fea7 RSI: 00000000200001c0 RDI: 0000000000000004 RBP: 00007f33488b41d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fffbec60d0f R14: 00007f33488b4300 R15: 0000000000022000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:btrfs_csum_one_bio+0x1010/0x1060 fs/btrfs/file-item.c:724 Code: e1 07 80 c1 03 38 c1 0f 8c a4 f3 ff ff 48 89 df e8 e5 a5 8e fe 48 8b 54 24 50 4c 8d 8c 24 20 01 00 00 4d 89 e0 e9 87 f3 ff ff <0f> 0b 44 89 f1 80 e1 07 38 c1 0f 8c fd fd ff ff be 08 00 00 00 4c RSP: 0018:ffffc9000ad67160 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000400140 RCX: 00000000fffbffff RDX: 0000000000000000 RSI: 1ffff1100ee99afd RDI: ffff8880774cd7ec RBP: ffffc9000ad67498 R08: 0000000000000dc0 R09: 00000000ffffffff R10: fffffbfff183f93b R11: 1ffffffff183f93a R12: 000000000000f000 R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000 FS: 00007f33488b4700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555d93a8ca38 CR3: 000000001bae4000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400