Skip to content

Commit cff1283

Browse files
committed
crypto: scomp - Disable BH when taking per-cpu spin lock
Disable BH when taking per-cpu spin locks. This isn't an issue right now because the only user zswap calls scomp from process context. However, if scomp is called from softirq context the spin lock may dead-lock. Signed-off-by: Herbert Xu <[email protected]>
1 parent 3d72ad4 commit cff1283

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crypto/scompress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
182182
dlen = req->dlen;
183183

184184
scratch = raw_cpu_ptr(&scomp_scratch);
185-
spin_lock(&scratch->lock);
185+
spin_lock_bh(&scratch->lock);
186186

187187
if (sg_nents(req->src) == 1 && !PageHighMem(sg_page(req->src))) {
188188
src = page_to_virt(sg_page(req->src)) + req->src->offset;
@@ -230,7 +230,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
230230
}
231231
}
232232
out:
233-
spin_unlock(&scratch->lock);
233+
spin_unlock_bh(&scratch->lock);
234234
return ret;
235235
}
236236

0 commit comments

Comments
 (0)