Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zswap: don't param_set_charp while holding spinlock
Change the zpool/compressor param callback function to release the zswap_pools_lock spinlock before calling param_set_charp, since that function may sleep when it calls kmalloc with GFP_KERNEL. While this problem has existed for a while, I wasn't able to trigger it using a tight loop changing either/both the zpool and compressor params; I think it's very unlikely to be an issue on the stable kernels, especially since most zswap users will change the compressor and/or zpool from sysfs only one time each boot - or zero times, if they add the params to the kernel boot. Fixes: c99b42c ("zswap: use charp for zswap param strings") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Dan Streetman <[email protected]> Reported-by: Sergey Senozhatsky <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Minchan Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information