void-packages/srcpkgs/kmod/patches/fix-error-path-when-loading-deps.patch
2012-01-13 10:19:30 +01:00

34 lines
1.1 KiB
Diff

From cb0d0b72128ac566aad9a72800c5a64af66f0b6e Mon Sep 17 00:00:00 2001
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Date: Sun, 8 Jan 2012 18:08:05 -0200
Subject: [PATCH] modprobe: fix error path when loading dependencies
demarchi> scenario is the following:
demarchi> modA depends on modB and modC
demarchi> if there's a race when trying to insert a dependency of a module, say
modB, it will stop loading all the modules
demarchi> it should check by "module already loaded error"
demarchi> like it does for modA
---
tools/kmod-modprobe.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
index eaf9346..2cda935 100644
--- a/tools/kmod-modprobe.c
+++ b/tools/kmod-modprobe.c
@@ -666,9 +666,11 @@ static int insmod_do_deps_list(struct kmod_module *parent, struct kmod_list *dep
flags |= KMOD_INSERT_FORCE_VERMAGIC;
r = kmod_module_insert_module(dm, flags, opts);
+ if (r == -EEXIST && !first_time)
+ r = 0;
if (r < 0) {
WRN("could not insert '%s': %s\n",
- dmname, strerror(-r));
+ dmname, strerror(-r));
goto dep_error;
}
}
--
1.7.8.1