Bug 211905

Summary: Can't unload gnbd module, 128 references
Product: Red Hat Enterprise Linux 5 Reporter: Linda Wang <lwang>
Component: kernelAssignee: Peter Zijlstra <pzijlstr>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: aviro, bmarzins, dzickus, lwang, syeghiay
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 5.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-17 20:00:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 210227    

Description Linda Wang 2006-10-23 19:46:51 UTC
+++ This bug was initially created as a clone of Bug #210227 +++

Description of problem:

When I load gnbd on system, it automatically has a ref count of 128 and I can't
unload the module.

Version-Release number of selected component (if applicable):
gnbd-1.1.2-1.el5
kmod-gnbd-0.1.1-12.2.6.18_1.2714.el5
udev-095-13


How reproducible:
100%

Steps to Reproduce:
1. modprobe gnbd
2. lsmod
3. modprobe -r gnbd
  
Actual results:
[root@morph-05 ~]# modprobe gnbd
[root@morph-05 ~]# lsmod | grep gnbd
gnbd                   73408  128 
[root@morph-05 ~]# modprobe -r gnbd
FATAL: Module gnbd is in use.

Expected results:

After loading the gnbd module, the ref count should be 0 and I should be able to
unload the module.

Additional info:

-- Additional comment from nstraz on 2006-10-10 16:36 EST --
I tried this on a Beta1 install and it works fine there.

[root@tank-01 ~]# rpm -q gnbd kmod-gnbd udev
gnbd-1.1.1-1.el5
kmod-gnbd-0.1.1-5.2.6.17_1.2519.4.21.el5
udev-095-8
[root@tank-01 ~]# lsmod | grep gnbd
[root@tank-01 ~]# modprobe gnbd
[root@tank-01 ~]# lsmod | grep gnbd
gnbd                   73408  0 
[root@tank-01 ~]# modprobe -r gnbd
[root@tank-01 ~]# lsmod | grep gnbd


-- Additional comment from kanderso on 2006-10-10 17:37 EST --
Devel ACK - QA found defect during regression testing, needs to be fixed for beta2.

-- Additional comment from bmarzins on 2006-10-10 17:42 EST --
Created an attachment (id=138198)
patch to make gnbd skip Persistent block device stuff

gnbd is based on the nbd kernel module. It creates a bunch of devices when
loaded that can be used for future gnbd imports.  It needs to skip the
Persistent block device stuff, same as nbd.

-- Additional comment from pm-rhel on 2006-10-10 17:48 EST --
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux release.  Product Management has requested further review
of this request by Red Hat Engineering.  This request is not yet committed for
inclusion in release.

-- Additional comment from nstraz on 2006-10-19 12:35 EST --
Verified w/ udev-095-14 from RHEL5-Server-20061019.0 tree.

-- Additional comment from nstraz on 2006-10-20 15:04 EST --
After further investigation, I'm still seeing this during testing.  I'm using a
fresh install of RHEL5-Server-20061019.0 with the following packages.

udev-095-14
gnbd-1.1.4-2.el5
kmod-gnbd-0.1.1-12.2.6.18_1.2732.el5


-- Additional comment from bmarzins on 2006-10-20 17:03 EST --
Yes. This is actually a different bug though. This is a kernel bug.  It seems
that any time you open a gnbd device that doesn't exist, you get increment the
module count.  Sometimes I can make this happen with nbd too. It doesn't happen
at all with 2.6.17 kernels, only the 2.6.18 ones.

If you can reliably reproduce this with nbd, please let me know and file a
generic kernel bug. I have simple program that just opens a file and exits

~bmarzins/public/opener.c

Any time after you insmod the gnbd module, you can run this. If it is the first
time that you have opened that device, you will increment the module usage count.

Since this only works on the first time, you need to remove
/etc/udev/rules.d/40-multipath.rules because this will automatically try to open
the device and cause this problem.  I am currently trying to trace this through
the kernel.

-- Additional comment from lwang on 2006-10-23 15:45 EST --
Yeah.. this may be a side effect of the lockdep fix for bd_mutex 
BZ#201773.  So clone this bug to track the kernel issue.

Comment 1 Linda Wang 2006-10-23 19:49:10 UTC
another similiar case of module reference count issue is in bug 210030

Comment 2 Suzanne Logcher 2006-10-23 19:54:06 UTC
*** Bug 211908 has been marked as a duplicate of this bug. ***

Comment 4 RHEL Program Management 2006-10-23 20:26:13 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux release.  Product Management has requested further review
of this request by Red Hat Engineering.  This request is not yet committed for
inclusion in release.

Comment 5 Don Zickus 2006-10-24 17:04:56 UTC
in kernel-2.6.18-1.2734.el5

Comment 6 Jay Turner 2006-10-24 17:21:06 UTC
QE ack for RHEL5B2.