Linux Device Mapper development
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Milan Broz <gmazyland@gmail.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Ming Lei <ming.lei@redhat.com>
Subject: Re: Regression in 5.0-rc4 device-mapper - integrity data invalid
Date: Tue, 5 Feb 2019 17:18:07 -0500	[thread overview]
Message-ID: <20190205221807.GA13749@redhat.com> (raw)
In-Reply-To: <579347b4-2a97-91c8-7f55-3a72d62829e9@gmail.com>

On Tue, Feb 05 2019 at 12:06pm -0500,
Milan Broz <gmazyland@gmail.com> wrote:

> Hi Mike,
> 
> since 5.0-rc4 we are not able to use LUKS2 devices with 4k sector size.
> 
> For example,
> # cryptsetup luksFormat --type luks2 -c aes-xts-plain64 --integrity hmac-sha256 /dev/sdc --sector-size 4096
> 
> fails with these syslog errors:
>   device-mapper: crypt: Integrity AEAD, tag size 32, IV size 0.
>   device-mapper: integrity: Invalid integrity data size 32768, expected 4096
>   device-mapper: integrity: Invalid integrity data size 32768, expected 4096
> 
> (with 512-byte sectors it seems to work ok)
> 
> Bisect shows this commit in rc4 is the problematic one (reverting fixes the problem):
> 
> commit 57c36519e4b949f89381053f7283f5d605595b42
> Author: Mike Snitzer <snitzer@redhat.com>
> Date:   Wed Jan 16 18:53:26 2019 -0500
> 
>     dm: fix clone_bio() to trigger blk_recount_segments()
>     
>     DM's clone_bio() now benefits from using bio_trim() by fixing the fact
>     that clone_bio() wasn't clearing BIO_SEG_VALID like bio_trim() does;
>     which triggers blk_recount_segments() via bio_phys_segments().
>     
>     Reviewed-by: Ming Lei <ming.lei@redhat.com>
>     Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> 
> Could you please check what is missing in the patch?

Could be that this bio_trim() check is causing it to return early?:

  if (offset == 0 && size == bio->bi_iter.bi_size)
     	     return;

But I'll just effectively revert 57c36519e4b94.  I don't have time right
now to dwell on _why_ this patch, which seemed to be obvious cleanup,
isn't safe.

Thanks!
Mike

  reply	other threads:[~2019-02-05 22:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 17:06 Regression in 5.0-rc4 device-mapper - integrity data invalid Milan Broz
2019-02-05 22:18 ` Mike Snitzer [this message]
2019-02-06  7:26   ` Milan Broz
2019-02-06 14:45     ` Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190205221807.GA13749@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=gmazyland@gmail.com \
    --cc=ming.lei@redhat.com \
    --cc=mpatocka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox