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>
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;
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;
struct acomp_walk walk;
int ret;
- ret = acomp_walk_virt(&walk, req);
+ ret = acomp_walk_virt(&walk, req, true);
if (ret)
return ret;
struct acomp_walk walk;
int ret;
- ret = acomp_walk_virt(&walk, req);
+ ret = acomp_walk_virt(&walk, req, true);
if (ret)
return ret;
int acomp_walk_next_src(struct acomp_walk *walk);
int acomp_walk_next_dst(struct acomp_walk *walk);
int acomp_walk_virt(struct acomp_walk *__restrict walk,
- struct acomp_req *__restrict req);
+ struct acomp_req *__restrict req, bool atomic);
static inline bool acomp_walk_more_src(const struct acomp_walk *walk, int cur)
{