Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: acomp - Clone folios properly

The folios contain references to the request itself so they must
be setup again in the cloned request.

Fixes: 5f3437e9c89e ("crypto: acomp - Simplify folio handling")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Herbert Xu 0efae411 8f66ccbd

+20 -6
+18
crypto/acompress.c
··· 566 566 } 567 567 EXPORT_SYMBOL_GPL(acomp_walk_virt); 568 568 569 + struct acomp_req *acomp_request_clone(struct acomp_req *req, 570 + size_t total, gfp_t gfp) 571 + { 572 + struct acomp_req *nreq; 573 + 574 + nreq = container_of(crypto_request_clone(&req->base, total, gfp), 575 + struct acomp_req, base); 576 + if (nreq == req) 577 + return req; 578 + 579 + if (req->src == &req->chain.ssg) 580 + nreq->src = &nreq->chain.ssg; 581 + if (req->dst == &req->chain.dsg) 582 + nreq->dst = &nreq->chain.dsg; 583 + return nreq; 584 + } 585 + EXPORT_SYMBOL_GPL(acomp_request_clone); 586 + 569 587 MODULE_LICENSE("GPL"); 570 588 MODULE_DESCRIPTION("Asynchronous compression type");
+2 -6
include/crypto/acompress.h
··· 551 551 return req; 552 552 } 553 553 554 - static inline struct acomp_req *acomp_request_clone(struct acomp_req *req, 555 - size_t total, gfp_t gfp) 556 - { 557 - return container_of(crypto_request_clone(&req->base, total, gfp), 558 - struct acomp_req, base); 559 - } 554 + struct acomp_req *acomp_request_clone(struct acomp_req *req, 555 + size_t total, gfp_t gfp); 560 556 561 557 #endif