]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
zram: do not lookup algorithm in backends table
authorSergey Senozhatsky <senozhatsky@chromium.org>
Fri, 24 Jun 2022 06:06:06 +0000 (15:06 +0900)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 20 Jul 2022 00:15:12 +0000 (20:15 -0400)
add comment

Link: https://lkml.kernel.org/r/20220624060606.1014474-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/zram/zcomp.c

index 398eb9e24eff499d2af70f38cea1d6d471cd4070..0916de952e091e2e38116bb548d84b127fcc0569 100644 (file)
@@ -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);