]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
modprobe: fix error path when loading dependencies
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Sun, 8 Jan 2012 20:08:05 +0000 (18:08 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sun, 8 Jan 2012 20:08:05 +0000 (18:08 -0200)
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

index eaf9346acf889452d3384067fbd7f6d85aa40e06..2cda93531fa789f507f0a597718f9497ceac27b6 100644 (file)
@@ -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;
                        }
                }