There were cases where error code would be used only if we finish processing
the last sector. If there were other encryption operations in flight, error
would be ignored and bio would be returned with success as if no error
happened.
This bug is present in kcryptd_crypt_write_convert, kcryptd_crypt_read_convert
and kcryptd_async_done.
This patch fixes it, setting io->error to -EIO always when an error happens.
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
03-19-2012, 11:21 AM
Milan Broz
dm-crypt: add missing error handling
On 01/24/2012 03:32 AM, Mikulas Patocka wrote:
dm-crypt: add missing error handling
There were cases where error code would be used only if we finish processing
the last sector. If there were other encryption operations in flight, error
would be ignored and bio would be returned with success as if no error
happened.
+static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io, int async)
{
struct bio *clone = io->ctx.bio_out;
struct crypt_config *cc = io->target->private;
- if (unlikely(error< 0)) {
+ if (unlikely(io->error< 0)) {
Remove unlikely()... it is removed elsewhere below in this patch and it really
makes no much sense here.
Reviewed-by: Milan Broz <mbroz@redhat.com>
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel