| From: Sergey Senozhatsky <senozhatsky@chromium.org> |
| Subject: zram: do not lookup algorithm in backends table |
| Date: Fri, 24 Jun 2022 15:06:06 +0900 |
| |
| 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 | 5 +++++ |
| 1 file changed, 5 insertions(+) |
| |
| --- a/drivers/block/zram/zcomp.c~zram-do-not-lookup-algorithm-in-backends-table-v2 |
| +++ a/drivers/block/zram/zcomp.c |
| @@ -211,6 +211,11 @@ struct zcomp *zcomp_create(const char *c |
| 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); |
| |
| _ |