module: use RCU to synchronize find_module

[ Upstream commit a006050575745ca2be25118b90f1c37f454ac542 ]

Allow for a RCU-sched critical section around find_module, following
the lower level find_module_all helper, and switch the two callers
outside of module.c to use such a RCU-sched critical section instead
of module_mutex.

Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Christoph Hellwig
2021-02-02 13:13:25 +01:00
committed by Greg Kroah-Hartman
parent 32edffff86
commit bef9d8b4f8
4 changed files with 6 additions and 6 deletions

View File

@@ -582,7 +582,7 @@ static inline bool within_module(unsigned long addr, const struct module *mod)
return within_module_init(addr, mod) || within_module_core(addr, mod);
}
/* Search for module by name: must hold module_mutex. */
/* Search for module by name: must be in a RCU-sched critical section. */
struct module *find_module(const char *name);
struct symsearch {