[dm-devel] [PATCH] dm-crypt: add missing error handling

Milan Broz mbroz at redhat.com
Mon Mar 19 12:21:19 UTC 2012

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 at redhat.com>

More information about the dm-devel mailing list