At last - a quick reproducer. This 15 line script oopses my kernel every time.
The cause then appears to be the removal of the qemu-nbd device before it has been unmounted.
I don't know if qemu-nbd is supposed to know that it shouldn't allow itself to be removed while mounted, or whether the kernel should be returning -EBUSY somewhere. I don't know that "just don't do that" is a sufficient answer here.
At last - a quick reproducer. This 15 line script oopses my kernel every time.
The cause then appears to be the removal of the qemu-nbd device before it has been unmounted.
I don't know if qemu-nbd is supposed to know that it shouldn't allow itself to be removed while mounted, or whether the kernel should be returning -EBUSY somewhere. I don't know that "just don't do that" is a sufficient answer here.