naota / linux

Linux kernel source tree
Other
3 stars 1 forks source link

WARNING: CPU: 3 PID: 9813 at fs/btrfs/inode.c:2290 extract_ordered_extent #46

Open kdave opened 3 years ago

kdave commented 3 years ago
[ 3637.366191] BTRFS: device label ZONED devid 1 transid 5 /dev/nullb0 scanned by mkfs.btrfs (9778)
[ 3637.551335] BTRFS info (device nullb0): has skinny extents
[ 3637.557170] BTRFS info (device nullb0): flagging fs with big metadata feature
[ 3637.587750] BTRFS info (device nullb0): host-managed zoned block device /dev/nullb0, 8 zones of 268435456 bytes
[ 3637.598565] BTRFS info (device nullb0): zoned mode enabled with zone size 268435456
[ 3637.613974] BTRFS info (device nullb0): enabling ssd optimizations
[ 3637.621884] BTRFS info (device nullb0): checking UUID tree
[ 3650.025532] ------------[ cut here ]------------
[ 3650.030516] WARNING: CPU: 3 PID: 9813 at fs/btrfs/inode.c:2290 extract_ordered_extent+0x6f/0x1d0 [btrfs]
[ 3650.040389] Modules linked in: null_blk af_packet btrfs i2c_algo_bit drm_ttm_helper ttm bridge drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm blake2b_generic libcrc32c xor zstd_decompress stp 
zstd_compress llc tpm_infineon tg3 iscsi_ibft tpm_tis tpm_tis_core iscsi_boot_sysfs tpm libphy xxhash raid6_pq mptctl i2c_piix4 serio_raw k10temp acpi_cpufreq button ext4 mbcache jbd2 ohci_pci ehci_pci mptsas ohci
_hcd ata_generic scsi_transport_sas ehci_hcd mptscsih mptbase usbcore sata_svw pata_serverworks sg scsi_dh_rdac scsi_dh_emc scsi_dh_alua
[ 3650.090244] CPU: 3 PID: 9813 Comm: kworker/u16:6 Tainted: G        W         5.13.0-rc2-git+ #761
[ 3650.090262] Hardware name: empty empty/S3993, BIOS PAQEX0-3 02/24/2008
[ 3650.090268] Workqueue: events_unbound btrfs_async_reclaim_data_space [btrfs]
[ 3650.090380] RIP: 0010:extract_ordered_extent+0x6f/0x1d0 [btrfs]
[ 3650.090459] Code: 33 01 00 00 48 3b 50 10 0f 85 39 01 00 00 48 8b 40 08 48 c1 e3 09 4a 8d 0c 2b 49 89 d8 48 01 c2 48 39 d1 77 05 48 39 d8 76 31 <0f> 0b 41 be ea ff ff ff 45 31 ff 4c 89 ff e8 ae 8c 01 00 48 89 e
f
[ 3650.090465] RSP: 0018:ffffae93056135e0 EFLAGS: 00010206
[ 3650.090472] RAX: 000000006fe92000 RBX: 000000006fe92000 RCX: 000000006feb1000
[ 3650.090476] RDX: 000000006fea8000 RSI: 0000000000000000 RDI: ffffffffba988b1d
[ 3650.090480] RBP: ffff9208009d49a8 R08: 000000006fe92000 R09: 00000000000c05ab
[ 3650.090484] R10: 0000000000000000 R11: 0000000000000001 R12: ffff920819e8b460
[ 3650.090487] R13: 000000000001f000 R14: 0000000000000000 R15: ffff9207f7ffc000
[ 3650.090491] FS:  0000000000000000(0000) GS:ffff9208e7400000(0000) knlGS:0000000000000000
[ 3650.090495] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 3650.090499] CR2: 00000000095d7058 CR3: 0000000181484000 CR4: 00000000000007e0
[ 3650.090504] Call Trace:
[ 3650.204519]  btrfs_submit_data_bio+0x18a/0x220 [btrfs]
[ 3650.204636]  submit_one_bio+0x44/0x70 [btrfs]
[ 3650.204735]  submit_extent_page+0x18e/0x2e0 [btrfs]
[ 3650.204844]  ? end_extent_writepage+0xe0/0xe0 [btrfs]
[ 3650.225041]  __extent_writepage_io+0x179/0x3e0 [btrfs]
[ 3650.230428]  ? end_extent_writepage+0xe0/0xe0 [btrfs]
[ 3650.230552]  __extent_writepage+0x13b/0x3e0 [btrfs]
[ 3650.230657]  extent_write_locked_range+0xf2/0x210 [btrfs]
[ 3650.230779]  run_delalloc_zoned+0x68/0x80 [btrfs]
[ 3650.230871]  btrfs_run_delalloc_range+0x12a/0x2a0 [btrfs]
[ 3650.230968]  writepage_delalloc+0xae/0x160 [btrfs]
[ 3650.231080]  __extent_writepage+0x108/0x3e0 [btrfs]
[ 3650.231183]  extent_write_cache_pages+0x263/0x470 [btrfs]
[ 3650.231320]  extent_writepages+0x54/0xc0 [btrfs]
[ 3650.231420]  do_writepages+0x35/0xd0
[ 3650.231444]  __writeback_single_inode+0x61/0x400
[ 3650.231465]  writeback_single_inode+0xa7/0x140
[ 3650.231477]  start_delalloc_inodes+0x182/0x450 [btrfs]
[ 3650.231584]  btrfs_start_delalloc_roots+0x194/0x2a0 [btrfs]
[ 3650.231706]  shrink_delalloc+0x10a/0x1f0 [btrfs]
[ 3650.306979]  flush_space+0x1bc/0x2e0 [btrfs]
[ 3650.307098]  btrfs_async_reclaim_data_space+0xb2/0x150 [btrfs]
[ 3650.307223]  process_one_work+0x262/0x5f0
[ 3650.307265]  worker_thread+0x4e/0x300
[ 3650.307273]  ? process_one_work+0x5f0/0x5f0
[ 3650.307299]  kthread+0x141/0x160
[ 3650.307314]  ? __kthread_bind_mask+0x60/0x60
[ 3650.307329]  ret_from_fork+0x1f/0x30
[ 3650.307387] irq event stamp: 401535
[ 3650.345274] hardirqs last  enabled at (401577): [<ffffffffba110417>] console_unlock+0x2b7/0x400
[ 3650.345282] hardirqs last disabled at (401582): [<ffffffffba10f1ac>] console_trylock_spinning+0x15c/0x1a0
[ 3650.345288] softirqs last  enabled at (401470): [<ffffffffbac00307>] __do_softirq+0x307/0x50f
[ 3650.345295] softirqs last disabled at (401465): [<ffffffffba08ad56>] irq_exit_rcu+0xb6/0xf0
[ 3650.345303] ---[ end trace 947a79fb8c19460a ]---
[ 3650.386935] ------------[ cut here ]------------
[ 3650.386939] WARNING: CPU: 3 PID: 9813 at fs/btrfs/inode.c:2277 extract_ordered_extent+0x17c/0x1d0 [btrfs]
[ 3650.387027] Modules linked in: null_blk af_packet btrfs i2c_algo_bit drm_ttm_helper ttm bridge drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm blake2b_generic libcrc32c xor zstd_decompress stp zstd_compress llc tpm_infineon tg3 iscsi_ibft tpm_tis tpm_tis_core iscsi_boot_sysfs tpm libphy xxhash raid6_pq mptctl i2c_piix4 serio_raw k10temp acpi_cpufreq button ext4 mbcache jbd2 ohci_pci ehci_pci mptsas ohci_hcd ata_generic scsi_transport_sas ehci_hcd mptscsih mptbase usbcore sata_svw pata_serverworks sg scsi_dh_rdac scsi_dh_emc scsi_dh_alua
[ 3650.402388] CPU: 3 PID: 9813 Comm: kworker/u16:6 Tainted: G        W         5.13.0-rc2-git+ #761
[ 3650.402395] Hardware name: empty empty/S3993, BIOS PAQEX0-3 02/24/2008
[ 3650.402399] Workqueue: events_unbound btrfs_async_reclaim_data_space [btrfs]
[ 3650.402542] RIP: 0010:extract_ordered_extent+0x17c/0x1d0 [btrfs]
[ 3650.402646] Code: da 8b 01 00 e9 1f ff ff ff 45 31 f6 45 31 ff e9 14 ff ff ff 0f 0b 48 83 c4 08 b8 0a 00 00 00 5b 5d 41 5c 41 5d 41 5e 41 5f c3 <0f> 0b 41 be ea ff ff ff 45 31 ff e9 ee fe ff ff 0f 0b 41 be ea ff
[ 3650.402651] RSP: 0018:ffffae93056135e0 EFLAGS: 00010206
[ 3650.402658] RAX: ffff9208300aec88 RBX: 000000000037f590 RCX: 0000000000000006
[ 3650.402661] RDX: 00000000000e4000 RSI: 0000000000000000 RDI: ffffffffba988b1d
[ 3650.402665] RBP: ffff9208300aec88 R08: 0000000000000001 R09: 00000000000c05ab
[ 3650.402669] R10: 0000000000000000 R11: 0000000000000001 R12: ffff920819e8b460
[ 3650.402672] R13: 000000000001f000 R14: 0000000000000000 R15: ffff9207f7ffc000
[ 3650.402676] FS:  0000000000000000(0000) GS:ffff9208e7400000(0000) knlGS:0000000000000000
[ 3650.402680] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 3650.402684] CR2: 00000000095d7058 CR3: 0000000181484000 CR4: 00000000000007e0
[ 3650.402688] Call Trace:
[ 3650.402713]  btrfs_submit_data_bio+0x18a/0x220 [btrfs]
[ 3650.402822]  submit_one_bio+0x44/0x70 [btrfs]
[ 3650.402916]  submit_extent_page+0x18e/0x2e0 [btrfs]
[ 3650.581645]  ? end_extent_writepage+0xe0/0xe0 [btrfs]
[ 3650.581749]  __extent_writepage_io+0x179/0x3e0 [btrfs]
[ 3650.581836]  ? end_extent_writepage+0xe0/0xe0 [btrfs]
[ 3650.597658]  __extent_writepage+0x13b/0x3e0 [btrfs]
[ 3650.597768]  extent_write_locked_range+0xf2/0x210 [btrfs]
[ 3650.597910]  run_delalloc_zoned+0x68/0x80 [btrfs]
[ 3650.613407]  btrfs_run_delalloc_range+0x12a/0x2a0 [btrfs]
[ 3650.613507]  writepage_delalloc+0xae/0x160 [btrfs]
[ 3650.613611]  __extent_writepage+0x108/0x3e0 [btrfs]
[ 3650.613717]  extent_write_cache_pages+0x263/0x470 [btrfs]
[ 3650.635007]  extent_writepages+0x54/0xc0 [btrfs]
[ 3650.635120]  do_writepages+0x35/0xd0
[ 3650.635150]  __writeback_single_inode+0x61/0x400
[ 3650.635183]  writeback_single_inode+0xa7/0x140
[ 3650.635209]  start_delalloc_inodes+0x182/0x450 [btrfs]
[ 3650.635336]  btrfs_start_delalloc_roots+0x194/0x2a0 [btrfs]
[ 3650.664310]  shrink_delalloc+0x10a/0x1f0 [btrfs]
[ 3650.664442]  flush_space+0x1bc/0x2e0 [btrfs]
[ 3650.664569]  btrfs_async_reclaim_data_space+0xb2/0x150 [btrfs]
[ 3650.679954]  process_one_work+0x262/0x5f0
[ 3650.684158]  worker_thread+0x4e/0x300
[ 3650.684165]  ? process_one_work+0x5f0/0x5f0
[ 3650.684179]  kthread+0x141/0x160
[ 3650.695779]  ? __kthread_bind_mask+0x60/0x60
[ 3650.695793]  ret_from_fork+0x1f/0x30
[ 3650.695840] irq event stamp: 403019
[ 3650.707699] hardirqs last  enabled at (403057): [<ffffffffba988ad4>] _raw_spin_unlock_irq+0x24/0x40
[ 3650.707709] hardirqs last disabled at (403062): [<ffffffffba10f1ac>] console_trylock_spinning+0x15c/0x1a0
[ 3650.707716] softirqs last  enabled at (403048): [<ffffffffbac00307>] __do_softirq+0x307/0x50f
[ 3650.707723] softirqs last disabled at (403043): [<ffffffffba08ad56>] irq_exit_rcu+0xb6/0xf0
[ 3650.707729] ---[ end trace 947a79fb8c19460b ]---
[ 3654.612625] BTRFS info (device nullb0): host-managed zoned block device /dev/nullb1, 8 zones of 268435456 bytes
[ 3654.641074] BTRFS info (device nullb0): disk added /dev/nullb1
[ 3684.512900] BTRFS info (device nullb0): reclaiming chunk 1073741824 with 23% used
[ 3684.522003] BTRFS info (device nullb0): relocating block group 1073741824 flags data
[ 3688.117672] BTRFS info (device nullb0): found 505 extents, stage: move data extents
[ 3688.622946] BTRFS info (device nullb0): found 505 extents, stage: update data pointers
kdave commented 3 years ago

nullb0 and b1 are 2G devices, reproducer script, expects to be run in btrfs-progs and uses .git

#!/bin/sh -x

dev=/dev/nullb0
dev2=/dev/nullb1
umount mnt
blkzone reset $dev
blkzone reset $dev2
blkzone report $dev
blkzone report $dev2
./mkfs.btrfs -L ZONED -f -d single -m single $dev
blkzone report $dev

mount $dev mnt || { echo error; exit 1; }

for i in `seq 20`; do
        dd if=/dev/zero of=mnt/file$i bs=1M count=65 status=progress
        ./btrfs filesystem sync mnt
done

for i in `seq 1 2 10`; do
        rm -f mnt/file$i
done
./btrfs filesystem df mnt; df -h mnt; blkzone report $dev
sync

echo "zones are probably full"
for i in `seq 10`; do
        rm -f mnt/file$i
done
sync
./btrfs filesystem df mnt; df -h mnt; blkzone report $dev

./btrfs device add -f $dev2 mnt

for i in `seq 10`; do
        dd if=/dev/zero of=mnt/file2$i bs=1M count=65 status=progress
        ./btrfs filesystem sync mnt
done

./btrfs filesystem df mnt; df -h mnt; blkzone report $dev

./btrfs subvolume create mnt/git
cp -a .git mnt/git
( cd mnt/git
git checkout -f master
for id in $(git rev-list master | shuf); do
        git checkout -f $id
        btrfs subvolume snapshot . ../snap-$id
done
)

until ./btrfs device delete $dev mnt; do
        sleep 1
        break;
done

umount mnt