Re: BUG at fs/btrfs/relocation.c:794! Still happening on misc-next and 5.8.3

Nikolay Borisov
2020-08-28T06:34:36Z

On 28.08.20 г. 3:08 ч., Zygo Blaxell wrote:
> On Thu, Aug 27, 2020 at 08:03:13PM -0400, Zygo Blaxell wrote:
>> On Tue, Aug 04, 2020 at 12:16:26PM -0400, Zygo Blaxell wrote:

<snip>

>>
>> Aug 23 05:04:05 regress kernel: [53458.128928][ T9737] BTRFS info (device dm-0): relocating block group 14939862335488 flags metadata|raid1
>> Aug 23 05:04:05 regress kernel: [53458.999342][ T9737] ------------[ cut here ]------------
>> Aug 23 05:04:05 regress kernel: [53459.000275][ T9737] kernel BUG at fs/btrfs/relocation.c:794!
>>
>> Aug 24 01:23:52 regress kernel: [58662.545914][T17474] BTRFS info (device dm-0): relocating block group 15083978620928 flags metadata|raid1
>> Aug 24 01:23:54 regress kernel: [58664.778274][T17474] ------------[ cut here ]------------
>> Aug 24 01:23:54 regress kernel: [58664.782182][T17474] kernel BUG at fs/btrfs/relocation.c:794!
>>
>> Aug 24 07:17:07 regress kernel: [21068.421134][T29457] BTRFS info (device dm-0): relocating block group 15160784715776 flags metadata|raid1
>> Aug 24 07:17:08 regress kernel: [21069.307661][ T5176] ------------[ cut here ]------------
>> Aug 24 07:17:08 regress kernel: [21069.309195][ T5176] kernel BUG at fs/btrfs/relocation.c:794!
>>
>> Aug 25 18:58:26 regress kernel: [22013.457555][ T2164] BTRFS info (device dm-0): relocating block group 15530051239936 flags metadata|raid1
>> Aug 25 18:58:27 regress kernel: [22014.460689][ T4939] ------------[ cut here ]------------
>> Aug 25 18:58:27 regress kernel: [22014.461653][ T4939] kernel BUG at fs/btrfs/relocation.c:794!
>>
>> Aug 26 03:39:20 regress kernel: [31172.016638][T30882] BTRFS info (device dm-0): relocating block group 15576759009280 flags metadata|raid1
>> Aug 26 03:39:21 regress kernel: [31173.329719][T12663] ------------[ cut here ]------------
>> Aug 26 03:39:21 regress kernel: [31173.330682][T12663] kernel BUG at fs/btrfs/relocation.c:794!
>>
>> Aug 26 16:00:02 regress kernel: [44334.231395][T25917] BTRFS info (device dm-0): relocating block group 15631888941056 flags data
>> Aug 26 16:00:04 regress kernel: [44336.800710][T26519] ------------[ cut here ]------------
>> Aug 26 16:00:04 regress kernel: [44336.802888][T26519] kernel BUG at fs/btrfs/relocation.c:794!
>>
>> Aug 27 15:45:29 regress kernel: [55423.626717][ T5878] BTRFS info (device dm-0): relocating block group 15820229967872 flags metadata|raid1
>> Aug 27 15:45:29 regress kernel: [55423.798584][T15744] ------------[ cut here ]------------
>> Aug 27 15:45:29 regress kernel: [55423.802581][T15744] kernel BUG at fs/btrfs/relocation.c:794!
>>
>> Aug 27 17:35:26 regress kernel: [ 6459.129124][T21053] BTRFS info (device dm-0): relocating block group 15831168712704 flags metadata|raid1
>> Aug 27 17:35:43 regress kernel: [ 6475.931029][T25720] ------------[ cut here ]------------
>> Aug 27 17:35:43 regress kernel: [ 6475.932403][T25720] kernel BUG at fs/btrfs/relocation.c:794!
>>
>> There don't seem to be any instances of the BUG that did not occur
>> within 30 seconds of starting a balance.
>>
>> The on-disk data is fine. After a reboot the same block group can be
>> successfully balanced.
>
> Forgot to mention the failure rate: 8 crashes (listed above) among 1492
> block groups balanced over the same 4-day period.

Since you can repro reliably could you modify the code in
create_reloc_root so it prints what's the returned error value, I'd
speculate it's EEXIST from

btrfs_insert_root
btrfs_insert_item
btrfs_insert_empty_item
btrfs_insert_empty_items
btrfs_search_slot

But better be sure.

>