Re: [PATCH] depmod: Make dependency loops be fatal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 9, 2014 at 3:14 PM, Lucas De Marchi
<lucas.demarchi@xxxxxxxxx> wrote:
> Since the beginning depmod just warned about dependency loops and upon
> creation of modules.dep{,.bin} it skipped the modules that were part of
> a loop. However just skipping the modules may come as a surprise to
> kernel module developers: they will need to try to load the module (or
> to pay attention to the log messages) to notice thavt the module has not
> been put in the index. Also, differently from module-init-tools we were
> not skipping modules that depend on modules with dependency loops,
> leading to a segfault in depmod.
>
> So this is a summary of the change in behavior with this patch:
>
> Loop 1)
>     A -> B -> C -
>     ^           |
>     '------------
>
>     Before:
>         depmod: WARNING: found 3 modules in dependency cycles!
>         depmod: WARNING: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleB.ko in dependency cycle!
>         depmod: WARNING: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleC.ko in dependency cycle!
>         depmod: WARNING: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleA.ko in dependency cycle!
>
>         return code: 0
>
>     After:
>         depmod: ERROR: Found 3 modules in dependency cycles!
>         depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleB.ko in dependency cycle!
>         depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleC.ko in dependency cycle!
>         depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleA.ko in dependency cycle!
>
>         return code: 2
>
> Loop 2)
>     A -> B -> C -
>          ^      |
>          '-------
>
>     Before:
>         depmod: WARNING: found 2 modules in dependency cycles!
>         depmod: WARNING: /tmp/test-kmod//lib/modules/3.14.2-1-ARCH/kernel/moduleB.ko in dependency cycle!
>         depmod: WARNING: /tmp/test-kmod//lib/modules/3.14.2-1-ARCH/kernel/moduleC.ko in dependency cycle!
>         Segmentation fault (core dumped)
>
>     After:
>         depmod: ERROR: Found 2 modules in dependency cycles!
>         depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleB.ko in dependency cycle!
>         depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleC.ko in dependency cycle!
>
>         return code: 2
>
> The segfault above could be fixed, but let's just fail everything
> because dependency cycles should be fixed in the modules rather than
> just be skipped in the index.
> ---
>  tools/depmod.c | 55 +++++++++----------------------------------------------
>  1 file changed, 9 insertions(+), 46 deletions(-)

This is now applied. It's better to fail the upgrade than to provide
the user a broken setup, that maybe can't even boot successfully. The
old behavior can be achieved by just disabling the module in the
kernel config.

--
Lucas De Marchi
--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux