mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-12-21 14:11:17 +07:00
kmodprobe: post-remove module deps with 0 refcnt
This commit is contained in:
parent
d98880ad5c
commit
0e9bd2d1ca
2
TODO
2
TODO
@ -18,8 +18,6 @@ Features:
|
||||
|
||||
* provide 1:1 compatibility with module-init-tools's modprobe
|
||||
- dump configuration
|
||||
- 'modprobe -r' should remove modules which usecount became 0 because of
|
||||
module's removal
|
||||
|
||||
* Add kmod_validate(). It checks if all config files and indexes are still
|
||||
valid. We need to save the mtime of each config dir when starting up and when
|
||||
|
@ -418,7 +418,7 @@ static int rmmod_do_dependencies(struct kmod_module *parent)
|
||||
static int rmmod_do(struct kmod_module *mod)
|
||||
{
|
||||
const char *modname = kmod_module_get_name(mod);
|
||||
struct kmod_list *pre = NULL, *post = NULL;
|
||||
struct kmod_list *pre = NULL, *post = NULL, *deps, *itr;
|
||||
int err;
|
||||
|
||||
if (!ignore_commands) {
|
||||
@ -508,6 +508,17 @@ done:
|
||||
}
|
||||
}
|
||||
|
||||
deps = kmod_module_get_dependencies(mod);
|
||||
if (deps) {
|
||||
kmod_list_foreach(itr, deps) {
|
||||
struct kmod_module *dep = kmod_module_get_module(itr);
|
||||
if (kmod_module_get_refcnt(dep) == 0) {
|
||||
rmmod_do(dep);
|
||||
}
|
||||
}
|
||||
kmod_module_unref_list(deps);
|
||||
}
|
||||
|
||||
error:
|
||||
kmod_module_unref_list(pre);
|
||||
kmod_module_unref_list(post);
|
||||
|
Loading…
Reference in New Issue
Block a user