From f526deb6dbeab7fdb53e7e6b9033899a4f118bae Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Date: Fri, 24 Jun 2022 15:06:06 +0900 Subject: [PATCH] zram: do not lookup algorithm in backends table add comment Link: https://lkml.kernel.org/r/20220624060606.1014474-1-senozhatsky@chromium.org Signed-off-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Nitin Gupta Signed-off-by: Andrew Morton --- drivers/block/zram/zcomp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c index 398eb9e24eff4..0916de952e091 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c @@ -211,6 +211,11 @@ struct zcomp *zcomp_create(const char *compress) struct zcomp *comp; int error; + /* + * Crypto API will execute /sbin/modprobe if the compression module + * is not loaded yet. We must do it here, otherwise we are about to + * call /sbin/modprobe under CPU hot-plug lock. + */ if (!zcomp_available_algorithm(compress)) return ERR_PTR(-EINVAL); -- 2.50.1