TITLE: kernel BUG in close_ctree
TYPE: BUG
PANICKED: Y

[  399.850178][T14930] BTRFS info (device loop1): has skinny extents
[  399.860119][ T3629] kernel BUG at fs/btrfs/ctree.h:3615!
[  399.864238][T14878] misc raw-gadget: fail, usb_gadget_register_driver returned -16
[  399.876597][ T3629] invalid opcode: 0000 [#1] PREEMPT SMP KASAN
[  399.879148][T14878] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy
[  399.882677][ T3629] CPU: 1 PID: 3629 Comm: syz-executor.5 Not tainted 5.19.0-syzkaller #0
[  399.882703][ T3629] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
[  399.882715][ T3629] RIP: 0010:assertfail.constprop.0+0x27/0x29
[  399.891554][   T27] audit: type=1804 audit(1664266785.680:487): pid=14918 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.6" name="/root/syzkaller-testdir1760768125/syzkaller.igm74c/219/file1" dev="sda1" ino=1959 res=1 errno=0
[  399.899315][ T3629] Code: 03 3c f8 41 54 41 89 f4 55 48 89 fd e8 81 03 3c f8 44 89 e1 48 89 ee 48 c7 c2 40 af 16 8a 48 c7 c7 80 af 16 8a e8 81 d2 f4 ff <0f> 0b e8 61 03 3c f8 e8 ac d7 88 f8 be 22 05 00 00 48 c7 c7 20 b0
[  399.899341][ T3629] RSP: 0018:ffffc900030dfc40 EFLAGS: 00010282
[  399.909862][T14878] misc raw-gadget: fail, usb_gadget_register_driver returned -16
[  399.915320][ T3629] 
[  399.915327][ T3629] RAX: 0000000000000051 RBX: ffff88807c0a0000 RCX: 0000000000000000
[  399.942465][T14878] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy
[  399.960230][ T3629] RDX: ffff88801fad9d80 RSI: ffffffff8160d218 RDI: fffff5200061bf7a
[  399.960249][ T3629] RBP: ffffffff8a16d740 R08: 0000000000000051 R09: 0000000000000000
[  399.960264][ T3629] R10: 0000000080000000 R11: 0000000000000001 R12: 0000000000001282
[  399.960278][ T3629] R13: 0000000000000000 R14: 0000000000000000 R15: ffffed100ee3c18a
[  399.960293][ T3629] FS:  00005555563c5400(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
[  399.960315][ T3629] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  399.960333][ T3629] CR2: 000000c011320a2c CR3: 00000000502ad000 CR4: 00000000003506e0
[  399.960348][ T3629] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  399.960361][ T3629] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  399.960376][ T3629] Call Trace:
[  399.960382][ T3629]  <TASK>
[  399.960392][ T3629]  close_ctree+0x49a/0xcfd
[  399.960427][ T3629]  ? btrfs_cleanup_one_transaction.cold+0x4f/0x4f
[  399.960462][ T3629]  ? hook_sb_remount+0xe0/0xe0
[  399.960512][ T3629]  ? __fsnotify_vfsmount_delete+0x20/0x20
[  399.960538][ T3629]  ? dispose_list+0x1e0/0x1e0
[  399.960563][ T3629]  ? btrfs_sync_fs+0x13b/0x770
[  399.960591][ T3629]  ? sync_blockdev+0x6f/0x90
[  399.960656][ T3629]  ? dlm_send_remote_unlock_request.constprop.0.cold+0x16/0x16
[  399.977569][T14878] misc raw-gadget: fail, usb_gadget_register_driver returned -16
[  399.984672][ T3629]  generic_shutdown_super+0x14c/0x400
[  400.012255][T14878] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy
[  400.016859][ T3629]  kill_anon_super+0x36/0x60
[  400.016889][ T3629]  btrfs_kill_super+0x38/0x50
[  400.051108][T14878] misc raw-gadget: fail, usb_gadget_register_driver returned -16
[  400.056255][ T3629]  deactivate_locked_super+0x94/0x160
[  400.120689][ T4697] ath9k_htc 6-1:1.0: ath9k_htc: Target is unresponsive
[  400.120884][ T3629]  deactivate_super+0xad/0xd0
[  400.128829][ T4697] ath9k_htc: Failed to initialize the device
[  400.134550][ T3629]  cleanup_mnt+0x3a2/0x540
[  400.134579][ T3629]  task_work_run+0xdd/0x1a0
[  400.183419][ T3629]  exit_to_user_mode_prepare+0x23c/0x250
[  400.189076][ T3629]  syscall_exit_to_user_mode+0x19/0x50
[  400.194588][ T3629]  do_syscall_64+0x42/0xb0
[  400.199095][ T3629]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
[  400.205073][ T3629] RIP: 0033:0x7f4b6e292d17
[  400.209510][ T3629] Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
[  400.229145][ T3629] RSP: 002b:00007fffcfa3ba28 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
[  400.237589][ T3629] RAX: 0000000000000000 RBX: 00000000000003ad RCX: 00007f4b6e292d17
[  400.245579][ T3629] RDX: 00007fffcfa3bafb RSI: 000000000000000a RDI: 00007fffcfa3baf0
[  400.253579][ T3629] RBP: 00007fffcfa3baf0 R08: 00000000ffffffff R09: 00007fffcfa3b8c0
[  400.261620][ T3629] R10: 00005555563c6853 R11: 0000000000000246 R12: 00007f4b6e2ec5d6
[  400.269610][ T3629] R13: 00007fffcfa3cbb0 R14: 00005555563c6810 R15: 00007fffcfa3cbf0
[  400.272867][ T3857] usb 2-1: new high-speed USB device number 89 using dummy_hcd
[  400.277586][ T3629]  </TASK>
[  400.277597][ T3629] Modules linked in:
[  400.279896][ T4067] usb 6-1: ath9k_htc: USB layer deinitialized
[  400.302317][ T3835] usb 8-1: USB disconnect, device number 43
[  400.309022][ T3629] ---[ end trace 0000000000000000 ]---
[  400.315728][ T3629] RIP: 0010:assertfail.constprop.0+0x27/0x29
[  400.322250][ T3629] Code: 03 3c f8 41 54 41 89 f4 55 48 89 fd e8 81 03 3c f8 44 89 e1 48 89 ee 48 c7 c2 40 af 16 8a 48 c7 c7 80 af 16 8a e8 81 d2 f4 ff <0f> 0b e8 61 03 3c f8 e8 ac d7 88 f8 be 22 05 00 00 48 c7 c7 20 b0
[  400.342978][ T3629] RSP: 0018:ffffc900030dfc40 EFLAGS: 00010282
[  400.349133][ T3629] RAX: 0000000000000051 RBX: ffff88807c0a0000 RCX: 0000000000000000
[  400.357428][ T3629] RDX: ffff88801fad9d80 RSI: ffffffff8160d218 RDI: fffff5200061bf7a
[  400.365673][ T3629] RBP: ffffffff8a16d740 R08: 0000000000000051 R09: 0000000000000000
[  400.372666][ T5677] usb 5-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[  400.373835][ T3629] R10: 0000000080000000 R11: 0000000000000001 R12: 0000000000001282
[  400.391876][ T3629] R13: 0000000000000000 R14: 0000000000000000 R15: ffffed100ee3c18a
[  400.399984][ T3629] FS:  00005555563c5400(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
[  400.420437][ T3871] BTRFS warning (device loop1): checksum verify failed on 30486528 wanted 0x552940c4 found 0x5f765460 level 0
[  400.423737][ T3629] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  400.450206][ T3629] CR2: 000000c011320a2c CR3: 00000000502ad000 CR4: 00000000003506e0
[  400.458601][T14930] BTRFS info (device loop1): enabling ssd optimizations
[  400.464804][ T3629] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  400.482184][ T3629] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  400.510423][ T3629] Kernel panic - not syncing: Fatal exception
[  400.516680][ T3629] Kernel Offset: disabled
[  400.521061][ T3629] Rebooting in 86400 seconds..
