[dm-crypt] Hang problem with dm-crypt

Yu, Wenqian wenqian.yu at intel.com
Mon Sep 26 08:50:09 CEST 2016

Hi, all,

I tried to use dm-crypt for disk encryption with accelerators and found that it will hang when accelerator returned EBUSY, which means the driver request queue is full.

Per the logic in crypt_convert(), the request will be skipped if the request is not sent to crypto driver when the driver request queue is full.  Is this expected behavior?

In crypt_convert_block(), the sector is advanced (bio_advance_iter()) no matter whether crypto_skcipher_encrypt()/crypto_skcipher_decrypt() send the request to accelerator driver or not.   When the driver request queue is full, EBUSY will be returned from crypto_skcipher_encrypt()/crypto_skcipher_decrypt().  And in crypt_convert(), the existing implementation is waiting for a completion from a request, which is not queued in the driver when EBUSY is encountered from crypt_convert_block ().  In this case, the sector should not be advanced or should be rolled back as the request is not sent to accelerator driver.


-          Wenqian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.saout.de/pipermail/dm-crypt/attachments/20160926/57d01d38/attachment.html>

More information about the dm-crypt mailing list