Created attachment 1179236 [details] kernel-4.5.7-300.fc24 backtrace Description of problem: I was half expecting it to break when I run it :-) but if one disconnect a NBD device before umounting, the kernel prints "kernel BUG at fs/buffer.c:2996!" and nbd cannot be used anymore until reboot I know that's not the latest kernel (4.5.7-300.fc24.x86_64) but I think latest kernel is affected too Version-Release number of selected component (if applicable): kernel-4.5.7-300.fc24.x86_64 qemu-img-2.6.0-4.fc24.x86_64 How reproducible: always Steps to Reproduce: Just mount a VM image through nbd and then disconnect the nbd device before umounting it 1. modprobe nbd max_part=63 2. qemu-nbd -c /dev/nbd0 overcloud-full.qcow2 3. mkdir /mnt/image 4. mount /dev/nbd0 /mnt/image 5. qemu-nbd -d /dev/nbd0 Actual results: dmesg contains "kernel BUG at fs/buffer.c:2996!" plus a backtrace More importantly, nbd cannot be used anymore until reboot Expected results: either an error message (busy device reported by the kernel to qemu-img) or having qemu-img umount the device first Additional info: I affected it to kernel but it could be fixed in qemu-img who could check if the device if used and either abort or go on after umounting it. It might be easier than to patch the kernel for rejecting the abort command if the device is still busy though that would be the safest path...
Created attachment 1184663 [details] kernel-4.6.3-300.fc24 backtrace Still valid with kernel 4.6.3-300
*********** MASS BUG UPDATE ************** We apologize for the inconvenience. There is a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 24 kernel bugs. Fedora 24 has now been rebased to 4.7.4-200.fc24. Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel. If you have moved on to Fedora 25, and are still experiencing this issue, please change the version to Fedora 25. If you experience different issues, please open a new bug report for those.
Created attachment 1208865 [details] 4.7.6 BUG in dmesg
In order to reproduce, you can insert "cd /mnt/image" between steps #4 & #5 in comment #0. Then running "ls" from that director after running "qemu-nbd -d /dev/nbd0" will results in: ls: reading directory '.': Input/output error And "ls /mnt/image" will result in a segfault with the kernel BUG in dmesg as attached
*********** MASS BUG UPDATE ************** We apologize for the inconvenience. There are a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 24 kernel bugs. Fedora 25 has now been rebased to 4.10.9-100.fc24. Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel. If you have moved on to Fedora 26, and are still experiencing this issue, please change the version to Fedora 26. If you experience different issues, please open a new bug report for those.
*********** MASS BUG UPDATE ************** This bug is being closed with INSUFFICIENT_DATA as there has not been a response in 2 weeks. If you are still experiencing this issue, please reopen and attach the relevant data from the latest kernel you are running and any data that might have been requested previously.