[PATCH] loopback: oops on loopback mount/umount (mainstream)
After LOOP_SET_FD/LOOP_CLR_FD combo loop device's queue gets request
handler which is persistent.
mount -t iso9660 /dev/loop0 /mnt # sic
this request handler is called directly with
a) ->lo_state being Lo_unbound
b) ->lo_pending being zero
Error path in loop_make_request() completes ->lo_bh_done completion
which is persistent as well.
Now, let's start worker thread as usual. It'll set ->lo_pending to 1,
don't wait for completion because it was already completed (brokenly),
and will not get out of infinite loop because of ->lo_pending. Loop
device doesn't have bios at this point and triggers BUG_ON.
So, don't complete ->lo_bh_done when loop device isn't setup fully.
In mainstream it was accidentaly fixed when converting to kthreads.