btrfs not writable when mounted without "skip_balance"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Yesterday, I upgraded to Ubuntu 20.04, since when there is a problem with the btrfs volume it is installed on. The system hung when launching a btrfs balance and on next boot, it hung indefinitely, when trying to created the volatile files and dirs.
Booting from a Debian buster rescue system, I noticed that I was unable to create or delete any files and I noticed the following in dmesg:
[Sun Aug 9 12:21:35 2020] ------------[ cut here ]------------
[Sun Aug 9 12:21:35 2020] kernel BUG at fs/btrfs/
[Sun Aug 9 12:21:35 2020] invalid opcode: 0000 [#1] SMP PTI
[Sun Aug 9 12:21:35 2020] CPU: 1 PID: 4537 Comm: btrfs-balance Tainted: G O 5.4.47 #1
[Sun Aug 9 12:21:35 2020] Hardware name: FUJITSU D3401-H1/D3401-H1, BIOS V5.0.0.11 R1.14.0 for D3401-H1x 06/09/2016
[Sun Aug 9 12:21:35 2020] RIP: 0010:select_
[Sun Aug 9 12:21:35 2020] Code: c0 c7 44 24 04 00 00 00 00 e8 8b 9d 17 e1 48 89 df 4c 89 f6 48 8d 54 24 04 e8 9c e6 ff ff 48 8b 58 60 48 89 c5 48 85 db 75 02 <0f> 0b 48 8b 43 20 a8 02 75 02 0f 0b 48 83 bb df 01 00 00 f8 75 45
[Sun Aug 9 12:21:35 2020] RSP: 0018:ffff8887e0
[Sun Aug 9 12:21:35 2020] RAX: ffff8887dfab5280 RBX: 0000000000000000 RCX: 0000000000000000
[Sun Aug 9 12:21:35 2020] RDX: ffff8887e0b0bb24 RSI: ffff8887e0b0bc10 RDI: ffff8887dfab52c0
[Sun Aug 9 12:21:35 2020] RBP: ffff8887dfab5280 R08: ffff8887dfab52c0 R09: ffffffffa0491e7e
[Sun Aug 9 12:21:35 2020] R10: ffff8887f4ba7e70 R11: ffff8888090ed158 R12: ffff8887dfab5280
[Sun Aug 9 12:21:35 2020] R13: ffff8887fd330800 R14: ffff8887e0b0bc10 R15: ffff8887e7fa66e8
[Sun Aug 9 12:21:35 2020] FS: 000000000000000
[Sun Aug 9 12:21:35 2020] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[Sun Aug 9 12:21:35 2020] CR2: 000055b4d5b7cfe0 CR3: 000000000200a004 CR4: 00000000003606e0
[Sun Aug 9 12:21:35 2020] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[Sun Aug 9 12:21:35 2020] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[Sun Aug 9 12:21:35 2020] Call Trace:
[Sun Aug 9 12:21:35 2020] do_relocation+
[Sun Aug 9 12:21:35 2020] ? calcu_metadata_
[Sun Aug 9 12:21:35 2020] ? do_raw_
[Sun Aug 9 12:21:35 2020] ? btrfs_block_
[Sun Aug 9 12:21:35 2020] relocate_
[Sun Aug 9 12:21:35 2020] ? tree_insert+
[Sun Aug 9 12:21:35 2020] ? add_tree_
[Sun Aug 9 12:21:35 2020] relocate_
[Sun Aug 9 12:21:35 2020] btrfs_relocate_
[Sun Aug 9 12:21:35 2020] btrfs_relocate_
[Sun Aug 9 12:21:35 2020] btrfs_balance+
[Sun Aug 9 12:21:35 2020] ? btrfs_balance+
[Sun Aug 9 12:21:35 2020] balance_
[Sun Aug 9 12:21:35 2020] kthread+0xf5/0xfa
[Sun Aug 9 12:21:35 2020] ? kthread_
[Sun Aug 9 12:21:35 2020] ret_from_
[Sun Aug 9 12:21:35 2020] Modules linked in: btrfs xor zstd_decompress zstd_compress lzo_compress lzo_decompress zlib_deflate raid6_pq libcrc32c sd_mod ipmi_devintf ipmi_msghandler sg x86_pkg_
[Sun Aug 9 12:21:36 2020] ---[ end trace 442b443de6cecc6e ]---
[Sun Aug 9 12:21:36 2020] RIP: 0010:select_
[Sun Aug 9 12:21:36 2020] Code: c0 c7 44 24 04 00 00 00 00 e8 8b 9d 17 e1 48 89 df 4c 89 f6 48 8d 54 24 04 e8 9c e6 ff ff 48 8b 58 60 48 89 c5 48 85 db 75 02 <0f> 0b 48 8b 43 20 a8 02 75 02 0f 0b 48 83 bb df 01 00 00 f8 75 45
So this is obviously a btrfs bug that got introduced by the newer btrfs code in the newer kernel, although, booting an older kernel didn't fix it. Apparently something about the fs is messed up now and no balance can be run. The only temporary remedy I found was to add the skip_balance mount option to /etc/fstab, but of course, this is a crutch, and when you can't run balance, then the fs is bound to run out of space at some point.
---
ProblemType: Bug
AlsaDevices:
total 0
crw-rw---- 1 root audio 116, 1 Aug 9 12:53 seq
crw-rw---- 1 root audio 116, 33 Aug 9 12:53 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
ApportVersion: 2.20.11-0ubuntu27.6
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
CasperMD5CheckR
DistroRelease: Ubuntu 20.04
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
Lsusb: Error: [Errno 2] No such file or directory: 'lsusb'
Lsusb-t: Error: [Errno 2] No such file or directory: 'lsusb'
Lsusb-v: Error: [Errno 2] No such file or directory: 'lsusb'
MachineType: FUJITSU D3401-H1
Package: linux (not installed)
PciMultimedia:
ProcEnviron:
TERM=screen-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=de_DE.UTF-8
SHELL=/bin/bash
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.187.2
RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
Tags: focal
Uname: Linux 5.4.0-42-generic x86_64
UpgradeStatus: Upgraded to focal on 2020-08-08 (1 days ago)
UserGroups: adm docker sudo
_MarkForUpload: True
dmi.bios.date: 06/09/2016
dmi.bios.vendor: FUJITSU // American Megatrends Inc.
dmi.bios.version: V5.0.0.11 R1.14.0 for D3401-H1x
dmi.board.name: D3401-H1
dmi.board.vendor: FUJITSU
dmi.board.version: S26361-D3401-H1
dmi.chassis.type: 3
dmi.chassis.vendor: FUJITSU
dmi.modalias: dmi:bvnFUJITSU/
dmi.product.family: ESPRIMO-FTS
dmi.product.name: D3401-H1
dmi.product.sku: S26361-Kxxx-Vyyy
dmi.sys.vendor: FUJITSU
Changed in linux: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
no longer affects: | linux |
If I mount with skip_balance, the following does not happen. But if I try to start a balance processes go into a D state and the balance hangs.
[ 173.488407] kernel BUG at ../fs/btrfs/ relocation. c:1449! lp150.12. 58-default #1 openSUSE Leap 15.0 reloc_root+ 0x1dc/0x1f0 [btrfs] 237910 EFLAGS: 00010282 0(0000) GS:ffff88041ebc 0000(0000) knlGS:000000000 0000000 reloc_root+ 0x5b/0xa0 [btrfs] root_in_ trans+0xb7/ 0xf0 [btrfs] root_in_ trans+0x4e/ 0x60 [btrfs] on+0xa6/ 0x410 [btrfs] prealloc_ file_range+ 0xbb/0x460 [btrfs] file_range+ 0x10/0x20 [btrfs] file_extent_ cluster+ 0x113/0x200 [btrfs] file_extent_ cluster+ 0x8d/0x470 [btrfs] end_transaction +0x1c1/ 0x2e0 [btrfs] data_extent+ 0x5f/0xc0 [btrfs] block_group+ 0x495/0x6f0 [btrfs] block_group+ 0x188/0x230 [btrfs] chunk+0x4a/ 0xf0 [btrfs] device+ 0x1c4/0x4c0 [btrfs] balance+ 0xd4/0xbe0 [btrfs] balance_ item.isra. 33+0x9a/ 0x350 [btrfs] replace_ lock.part. 6+0x15/ 0x20 [btrfs] replace_ lock+0x85/ 0x90 [btrfs] 0x2de/0x5c0 [btrfs] 0x5c0/0x5c0 [btrfs] kthread+ 0x56/0x80 [btrfs] create_ on_node+ 0x40/0x40 fork+0x35/ 0x40
[ 173.488410] invalid opcode: 0000 [#1] SMP PTI
[ 173.488414] CPU: 7 PID: 2542 Comm: btrfs-balance Tainted: G O 4.12.14-
[ 173.488416] Hardware name: Dell Inc. OptiPlex 9020/00V62H, BIOS A24 10/24/2018
[ 173.488417] task: ffff8803c85f80c0 task.stack: ffffc90002234000
[ 173.488439] RIP: 0010:create_
[ 173.488440] RSP: 0018:ffffc90002
[ 173.488442] RAX: 00000000ffffffef RBX: ffff880408c99c00 RCX: 0000000000000001
[ 173.488444] RDX: 0000000000000005 RSI: ffff88040bdc2a80 RDI: 0000000000000286
[ 173.488445] RBP: ffff8803dd514d98 R08: ffff88040b8c5a80 R09: 0000000000000000
[ 173.488447] R10: 0000000000000002 R11: ffff88040bdc2a80 R12: fffffffffffffff7
[ 173.488448] R13: ffff88040679c000 R14: ffff8803efafe800 R15: 00000000000c4000
[ 173.488450] FS: 000000000000000
[ 173.488451] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 173.488453] CR2: 00007f26c9915b00 CR3: 000000000200a006 CR4: 00000000001606e0
[ 173.488454] Call Trace:
[ 173.488468] btrfs_init_
[ 173.488478] record_
[ 173.488488] btrfs_record_
[ 173.488497] start_transacti
[ 173.488506] __btrfs_
[ 173.488516] btrfs_prealloc_
[ 173.488527] prealloc_
[ 173.488537] relocate_
[ 173.488546] ? __btrfs_
[ 173.488555] relocate_
[ 173.488564] relocate_
[ 173.488573] btrfs_relocate_
[ 173.488583] btrfs_relocate_
[ 173.488592] btrfs_shrink_
[ 173.488602] __btrfs_
[ 173.488611] ? insert_
[ 173.488614] ? printk+0x43/0x4b
[ 173.488624] ? btrfs_dev_
[ 173.488634] ? btrfs_dev_
[ 173.488643] btrfs_balance+
[ 173.488651] ? btrfs_balance+
[ 173.488659] balance_
[ 173.488662] kthread+0x11a/0x130
[ 173.488664] ? kthread_
[ 173.488667] ret_from_
[ 173.488669] Code: 48 c7 83 dc 00 00 00 00 00 00 00 48 c7 83 e4 00 00 00 00 00 00 00 c6 83 ec 00 00 00 00 c6 83 ed 00 00 00 00 e9 1b ff ff ff 0f 0b <0f> 0b 0f 0b 0f 0b 0f 0b 66 66 2e 0f 1f 84 00 00 00 00 00 90 0f
[ 173.488687] Modules linked in: usblp ccm af_packet ebtable_filter ebtables nf_log_ipv6 xt_comment nf_log_ipv4 nf_log_common xt_LOG xt_limit devlink nfnetlink_cthelper nfnetlink vboxpci(O) vboxnetadp(O) vboxnetflt(O) ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ipt_REJECT xt_pk...