Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1356110 - "kernel BUG at fs/buffer.c:2996!" when unplugging nbd with "qemu-nbd -d /dev/nbd0" while still mounted [NEEDINFO]
Summary: "kernel BUG at fs/buffer.c:2996!" when unplugging nbd with "qemu-nbd -d /dev/...
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 24
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-13 12:33 UTC by Thierry Vignaud
Modified: 2017-04-28 17:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-28 17:26:35 UTC
jforbes: needinfo?


Attachments (Terms of Use)
kernel-4.5.7-300.fc24 backtrace (deleted)
2016-07-13 12:33 UTC, Thierry Vignaud
no flags Details
kernel-4.6.3-300.fc24 backtrace (deleted)
2016-07-27 13:57 UTC, Thierry Vignaud
no flags Details
4.7.6 BUG in dmesg (deleted)
2016-10-10 12:59 UTC, Thierry Vignaud
no flags Details

Description Thierry Vignaud 2016-07-13 12:33:53 UTC
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...

Comment 1 Thierry Vignaud 2016-07-27 13:57:38 UTC
Created attachment 1184663 [details]
kernel-4.6.3-300.fc24 backtrace

Still valid with kernel 4.6.3-300

Comment 2 Laura Abbott 2016-09-23 19:21:18 UTC
*********** 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.

Comment 3 Thierry Vignaud 2016-10-10 12:59:49 UTC
Created attachment 1208865 [details]
4.7.6 BUG in dmesg

Comment 4 Thierry Vignaud 2016-10-10 13:01:38 UTC
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

Comment 5 Justin M. Forbes 2017-04-11 14:49:57 UTC
*********** 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.

Comment 6 Justin M. Forbes 2017-04-28 17:26:35 UTC
*********** 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.


Note You need to log in before you can comment on or make changes to this bug.