summaryrefslogtreecommitdiffstats
path: root/lib/test_sysctl.c
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2019-05-29 13:26:25 +0200
committerJessica Yu <jeyu@kernel.org>2019-06-05 09:53:24 +0200
commit6e6de3dee51a439f76eb73c22ae2ffd2c9384712 (patch)
tree8ab6a8fa8c082d4e981cb7f9572ec7d0f6462640 /lib/test_sysctl.c
parentLinux 5.2-rc2 (diff)
downloadlinux-6e6de3dee51a439f76eb73c22ae2ffd2c9384712.tar.xz
linux-6e6de3dee51a439f76eb73c22ae2ffd2c9384712.zip
kernel/module.c: Only return -EEXIST for modules that have finished loading
Microsoft HyperV disables the X86_FEATURE_SMCA bit on AMD systems, and linux guests boot with repeated errors: amd64_edac_mod: Unknown symbol amd_unregister_ecc_decoder (err -2) amd64_edac_mod: Unknown symbol amd_register_ecc_decoder (err -2) amd64_edac_mod: Unknown symbol amd_report_gart_errors (err -2) amd64_edac_mod: Unknown symbol amd_unregister_ecc_decoder (err -2) amd64_edac_mod: Unknown symbol amd_register_ecc_decoder (err -2) amd64_edac_mod: Unknown symbol amd_report_gart_errors (err -2) The warnings occur because the module code erroneously returns -EEXIST for modules that have failed to load and are in the process of being removed from the module list. module amd64_edac_mod has a dependency on module edac_mce_amd. Using modules.dep, systemd will load edac_mce_amd for every request of amd64_edac_mod. When the edac_mce_amd module loads, the module has state MODULE_STATE_UNFORMED and once the module load fails and the state becomes MODULE_STATE_GOING. Another request for edac_mce_amd module executes and add_unformed_module() will erroneously return -EEXIST even though the previous instance of edac_mce_amd has MODULE_STATE_GOING. Upon receiving -EEXIST, systemd attempts to load amd64_edac_mod, which fails because of unknown symbols from edac_mce_amd. add_unformed_module() must wait to return for any case other than MODULE_STATE_LIVE to prevent a race between multiple loads of dependent modules. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Barret Rhoden <brho@google.com> Cc: David Arcari <darcari@redhat.com> Cc: Jessica Yu <jeyu@kernel.org> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Jessica Yu <jeyu@kernel.org>
Diffstat (limited to 'lib/test_sysctl.c')
0 files changed, 0 insertions, 0 deletions