BUSE
BUSE copied to clipboard
after exiting, lsblk still shows /dev/nbd0
Hey, I recently ran into an incident. I ran ./loopback /dev/loop0 /dev/nbd0. Then I ran lsblk. It shows: nbd0 43:0 0 30M 0 disk Then I mount /dev/nbd0 /mnt I wrote some files on /mnt. Then I umount -l /mnt Then I use ctr + C to terminate ./loopback. I lsblk again, it still shows: nbd0 43:0 0 30M 0 disk However, /dev/nbd0 should not appear on lsblk at this moment. Is this a bug or I should not use lazy umount?
It looks like a bug to me although I couldn't reproduce it (tried with kernel 4.18.14). So I got few questions to help me debug this:
- Which kernel version are you using?
- Are there related messages in kernel log?
- What is the result of running
nbd-client -c /dev/nbd0
on a "zombie" blockdev (output and exit status)? - Does requesting disconnect manually by
nbd-client -d /dev/nbd0
fix "zombie" blockdev?
I remember I had issues with terminating BUSE once (some time ago, now they are gone). It occurred randomly, so I suspect race condition. I wrote a fix for this - check it out and try if you want. Rev 3d5ca361c752550b0dc39ddef3d9768daa423b55 (not merged into master)