bcachefs (loop0): /file0/file0 offset 0: data_read_io_err
u64s 8 type extent 4099:8:U32_MAX len 8 ver 1: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum chacha20_poly1305_80 77fa:f532966a693125aa compress incompressible ptr: 0:34:0 gen 0
bcachefs (loop0): /file0/file0 offset 0: data read error: data_read_io_err
bcachefs (loop0): /file0/file0 offset 0: data read error, data_read_io_err
u64s 8 type extent 4099:8:U32_MAX len 8 ver 1: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum chacha20_poly1305_80 77fa:f532966a693125aa compress incompressible ptr: 0:34:0 gen 0
loop0 io error
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
kworker/u4:6/1038 is trying to acquire lock:
ffff888055be01b0 (bcachefs_btree){+.+.}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:161 [inline]
ffff888055be01b0 (bcachefs_btree){+.+.}-{0:0}, at: srcu_read_lock include/linux/srcu.h:253 [inline]
ffff888055be01b0 (bcachefs_btree){+.+.}-{0:0}, at: __bch2_trans_get+0x7f4/0xd80 fs/bcachefs/btree_iter.c:3505
but task is already holding lock:
ffff888055bec1b0 (bcachefs_btree){+.+.}-{0:0}, at: trans_set_locked fs/bcachefs/btree_locking.h:206 [inline]
ffff888055bec1b0 (bcachefs_btree){+.+.}-{0:0}, at: bch2_trans_begin+0xbe0/0x2310 fs/bcachefs/btree_iter.c:3403
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(bcachefs_btree);
lock(bcachefs_btree);
*** DEADLOCK ***
May be due to missing lock nesting notation
5 locks held by kworker/u4:6/1038:
#0: ffff88801a879148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3211 [inline]
#0: ffff88801a879148 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0 kernel/workqueue.c:3319
#1: ffffc9000262fbc0 ((work_completion)(&rbio->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3212 [inline]
#1: ffffc9000262fbc0 ((work_completion)(&rbio->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0 kernel/workqueue.c:3319
#2: ffff888052f84398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:161 [inline]
#2: ffff888052f84398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:253 [inline]
#2: ffff888052f84398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: bch2_trans_srcu_lock+0xaf/0x220 fs/bcachefs/btree_iter.c:3299
#3: ffff888055bec1b0 (bcachefs_btree){+.+.}-{0:0}, at: trans_set_locked fs/bcachefs/btree_locking.h:206 [inline]
#3: ffff888055bec1b0 (bcachefs_btree){+.+.}-{0:0}, at: bch2_trans_begin+0xbe0/0x2310 fs/bcachefs/btree_iter.c:3403
#4: ffff888052f84398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:161 [inline]
#4: ffff888052f84398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:253 [inline]
#4: ffff888052f84398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7f4/0xd80 fs/bcachefs/btree_iter.c:3505
stack backtrace:
CPU: 0 UID: 0 PID: 1038 Comm: kworker/u4:6 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: events_unbound bch2_rbio_retry
Call Trace:
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_deadlock_bug+0x28b/0x2a0 kernel/locking/lockdep.c:3041
check_deadlock kernel/locking/lockdep.c:3093 [inline]
validate_chain+0x1a3f/0x2140 kernel/locking/lockdep.c:3895
__lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868
trans_set_locked fs/bcachefs/btree_locking.h:206 [inline]
__bch2_trans_get+0x8fd/0xd80 fs/bcachefs/btree_iter.c:3508
bch2_rbio_retry+0x1d1/0x19b0 fs/bcachefs/io_read.c:594
bch2_rbio_done fs/bcachefs/io_read.c:464 [inline]
bch2_rbio_retry+0xbf4/0x19b0 fs/bcachefs/io_read.c:667
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
kthread+0x711/0x8a0 kernel/kthread.c:463
ret_from_fork+0x439/0x7d0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
bcachefs (loop0): /file0/file0 offset 0: data_read_io_err
u64s 8 type extent 4099:8:U32_MAX len 8 ver 1: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum chacha20_poly1305_80 77fa:f532966a693125aa compress incompressible ptr: 0:34:0 gen 0
bcachefs (loop0): /file0/file0 offset 0: data read error: data_read_io_err
bcachefs (loop0): /file0/file0 offset 0: data read error, data_read_io_err
u64s 8 type extent 4099:8:U32_MAX len 8 ver 1: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum chacha20_poly1305_80 77fa:f532966a693125aa compress incompressible ptr: 0:34:0 gen 0
loop0 io error
bcachefs (loop0): /file0/file0 offset 0: data_read_io_err
u64s 8 type extent 4099:8:U32_MAX len 8 ver 1: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum chacha20_poly1305_80 77fa:f532966a693125aa compress incompressible ptr: 0:34:0 gen 0
bcachefs (loop0): /file0/file0 offset 0: data read error: data_read_io_err
bcachefs (loop0): /file0/file0 offset 0: data read error, data_read_io_err
u64s 8 type extent 4099:8:U32_MAX len 8 ver 1: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum chacha20_poly1305_80 77fa:f532966a693125aa compress incompressible ptr: 0:34:0 gen 0
loop0 io error
------------[ cut here ]------------
kernel BUG at fs/bcachefs/btree_iter.c:3462!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 1038 Comm: kworker/u4:6 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: events_unbound bch2_rbio_retry
RIP: 0010:__bch2_trans_get+0xce2/0xd80 fs/bcachefs/btree_iter.c:3460
Code: fd e9 81 f4 ff ff 44 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 9b fa ff ff 4c 89 ff e8 29 7e f9 fd e9 8e fa ff ff e8 3f 81 94 fd 90 <0f> 0b 44 89 e1 80 e1 07 80 c1 03 38 c1 0f 8c 45 fd ff ff 4c 89 e7
RSP: 0018:ffffc9000262f460 EFLAGS: 00010293
RAX: ffffffff842b4961 RBX: ffff888055be0000 RCX: ffff8880359b2440
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000000
RBP: 0000000000000004 R08: ffffffff8fc3c837 R09: 1ffffffff1f87906
R10: dffffc0000000000 R11: fffffbfff1f87907 R12: ffff888052f84200
R13: 000000000000040e R14: dffffc0000000000 R15: ffff888055bec1d8
FS: 0000000000000000(0000) GS:ffff88808d007000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f0254bcbfc8 CR3: 000000004316c000 CR4: 0000000000352ef0
Call Trace:
bch2_rbio_retry+0x1d1/0x19b0 fs/bcachefs/io_read.c:594
bch2_rbio_done fs/bcachefs/io_read.c:464 [inline]
bch2_rbio_retry+0xbf4/0x19b0 fs/bcachefs/io_read.c:667
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
kthread+0x711/0x8a0 kernel/kthread.c:463
ret_from_fork+0x439/0x7d0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__bch2_trans_get+0xce2/0xd80 fs/bcachefs/btree_iter.c:3460
Code: fd e9 81 f4 ff ff 44 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 9b fa ff ff 4c 89 ff e8 29 7e f9 fd e9 8e fa ff ff e8 3f 81 94 fd 90 <0f> 0b 44 89 e1 80 e1 07 80 c1 03 38 c1 0f 8c 45 fd ff ff 4c 89 e7
RSP: 0018:ffffc9000262f460 EFLAGS: 00010293
RAX: ffffffff842b4961 RBX: ffff888055be0000 RCX: ffff8880359b2440
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000000
RBP: 0000000000000004 R08: ffffffff8fc3c837 R09: 1ffffffff1f87906
R10: dffffc0000000000 R11: fffffbfff1f87907 R12: ffff888052f84200
R13: 000000000000040e R14: dffffc0000000000 R15: ffff888055bec1d8
FS: 0000000000000000(0000) GS:ffff88808d007000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f0254bcbfc8 CR3: 000000004316c000 CR4: 0000000000352ef0