Comment 7 for bug 1784665

I think I've got one. It doesn't always hang the mkfs, but it does wedge bcache in a few ways.

[ 484.322546] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 484.326230] INFO: task bcache_allocato:32503 blocked for more than 120 seconds.

1) when it occurs, a backing device never get's released from the kernel, such that a blockdev --rereadpt on the device says the device is busy, but examining /sys/class/block/<dev>/holders shows nothing

2) attempts to open the device exclusively fail (so things like mkfs or make-bcache -B).

The reproducer has two virtio disks, vda, vdb; size doesn't really matter, but they are 10G and 2G respectively. /dev/vdb is a cache set (make-bcache -C /dev/vdb), /dev/vda2 is the backing device (make-bcache -B /dev/vda2) and then they are joined (echo $CSET_UUID > /sys/class/block/vda/vda2/bcache/attach), which results in a /dev/bcache0. Then we mkfs.ext4 it.

Then we tear it down, wipe the partitions, the disks and repeat.

I'll attach the script.