From: Sergey Senozhatsky Date: Fri, 24 Jun 2022 06:06:06 +0000 (+0900) Subject: zram: do not lookup algorithm in backends table X-Git-Tag: maple_v12_fixes~29 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f526deb6dbeab7fdb53e7e6b9033899a4f118bae;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c index 398eb9e24eff..0916de952e09 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);