Re: kldunload(8) returns 0, although it fail

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: John Baldwin
Date: Tuesday, November 9, 2010 - 6:44 am

On Tuesday, November 09, 2010 6:46:12 am Alexander Best wrote:

Did you get an error message in dmesg?  If you have manually loaded
netgraph.ko (via netgraph_load="YES" in loader.conf or an explicit kldload)
and then loaded other modules that depend on it (such as ng_foo.ko) then this
is expected behavior.  What your kldunload has done is to remove the manual
reference from loader.conf or 'kldload netgraph.ko'.  What this changes is what
happens when you do 'kldunload ng_foo.ko'.  If you unload ng_foo.ko now, then
netgraph.ko will also be unloaded when its last reference drops (in this case
it looks like you actually have two ng_*.ko objects loaded, so you would have
to unload both of them, but I will assume a single ng_foo.ko to make the
explanation simpler).  If you had not done 'kldunload netgraph.ko' but had
done 'kldunload ng_foo.ko', then the manual reference would have kept netgraph.ko
loaded.

All this logic exists so that if you do 'kldload foo.ko' and it auto-loads bar.ko
as a dependency, then doing 'kldunload bar.ko' will unload both foo.ko and bar.ko.

-- 
John Baldwin
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
kldunload(8) returns 0, although it fail, Alexander Best, (Tue Nov 9, 4:46 am)
Re: kldunload(8) returns 0, although it fail, John Baldwin, (Tue Nov 9, 6:44 am)
Re: kldunload(8) returns 0, although it fail, Alexander Best, (Tue Nov 9, 7:10 am)
Re: kldunload(8) returns 0, although it fail, John Baldwin, (Tue Nov 9, 7:37 am)
Re: kldunload(8) returns 0, although it fail, Alexander Best, (Wed Nov 10, 2:58 pm)
Re: kldunload(8) returns 0, although it fail, Alexander Best, (Wed Nov 10, 3:07 pm)
Re: kldunload(8) returns 0, although it fail, John Baldwin, (Wed Nov 10, 3:17 pm)
Re: kldunload(8) returns 0, although it fail, Alexander Best, (Tue Nov 16, 8:20 pm)
Re: kldunload(8) returns 0, although it fail, John Baldwin, (Wed Nov 17, 8:06 am)
Re: kldunload(8) returns 0, although it fail, Alexander Best, (Wed Nov 17, 10:11 am)
Re: kldunload(8) returns 0, although it fail, Alexander Best, (Wed Nov 17, 2:38 pm)