Skip to content

Commit 6fd2cb3

Browse files
Hou TaoMikulas Patocka
authored andcommitted
dm-crypt: set atomic as false when calling crypt_convert() in kworker
Both kcryptd_crypt_write_continue() and kcryptd_crypt_read_continue() are running in the kworker context, it is OK to call cond_resched(), Therefore, set atomic as false when invoking crypt_convert() under kworker context. Signed-off-by: Hou Tao <[email protected]> Reviewed-by: Ignat Korchagin <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 6845de7 commit 6fd2cb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/md/dm-crypt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ static void kcryptd_crypt_write_continue(struct work_struct *work)
20982098
wait_for_completion(&ctx->restart);
20992099
reinit_completion(&ctx->restart);
21002100

2101-
r = crypt_convert(cc, &io->ctx, true, false);
2101+
r = crypt_convert(cc, &io->ctx, false, false);
21022102
if (r)
21032103
io->error = r;
21042104
crypt_finished = atomic_dec_and_test(&ctx->cc_pending);
@@ -2203,7 +2203,7 @@ static void kcryptd_crypt_read_continue(struct work_struct *work)
22032203
wait_for_completion(&io->ctx.restart);
22042204
reinit_completion(&io->ctx.restart);
22052205

2206-
r = crypt_convert(cc, &io->ctx, true, false);
2206+
r = crypt_convert(cc, &io->ctx, false, false);
22072207
if (r)
22082208
io->error = r;
22092209

0 commit comments

Comments
 (0)