summaryrefslogtreecommitdiff
path: root/crypto/acompress.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-04-15 12:23:19 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2025-04-17 05:41:47 +0300
commitddd0855fa3c3f1de020ab3aeddce15fe38e116f7 (patch)
tree690e1055674ddcd0d5c519b6f52278e86cdeea2f /crypto/acompress.c
parent2f5f3cd003fa303574da1a8fcdec9f602b7fc221 (diff)
downloadlinux-ddd0855fa3c3f1de020ab3aeddce15fe38e116f7.tar.xz
crypto: deflate - Make the acomp walk atomic
Add an atomic flag to the acomp walk and use that in deflate. Due to the use of a per-cpu context, it is impossible to sleep during the walk in deflate. Reported-by: kernel test robot <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202504151654.4c3b6393-lkp@intel.com Fixes: 08cabc7d3c86 ("crypto: deflate - Convert to acomp") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/acompress.c')
-rw-r--r--crypto/acompress.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/acompress.c b/crypto/acompress.c
index 606d09a7fbfd..b0f9192f6b2e 100644
--- a/crypto/acompress.c
+++ b/crypto/acompress.c
@@ -536,7 +536,7 @@ int acomp_walk_next_dst(struct acomp_walk *walk)
EXPORT_SYMBOL_GPL(acomp_walk_next_dst);
int acomp_walk_virt(struct acomp_walk *__restrict walk,
- struct acomp_req *__restrict req)
+ struct acomp_req *__restrict req, bool atomic)
{
struct scatterlist *src = req->src;
struct scatterlist *dst = req->dst;
@@ -548,7 +548,7 @@ int acomp_walk_virt(struct acomp_walk *__restrict walk,
return -EINVAL;
walk->flags = 0;
- if ((req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP))
+ if ((req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) && !atomic)
walk->flags |= ACOMP_WALK_SLEEP;
if ((req->base.flags & CRYPTO_ACOMP_REQ_SRC_VIRT))
walk->flags |= ACOMP_WALK_SRC_LINEAR;