Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-09 Thread Christoph Hellwig
On Sat, Aug 05, 2017 at 04:19:30PM -0400, Martin K. Petersen wrote: > A bio flag is probably the path of least resistance. It already exists, > actually: BIP_BLOCK_INTEGRITY. But we'll need to make sure it gets > masked out when a bio is cloned. And then we can key off of that and > REQ_OP_READ in

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-07 Thread Milan Broz
Hi, On 08/07/2017 05:48 PM, Martin K. Petersen wrote: > >> If you create the integrity tag at or above device mapper level, you >> will run into problems because the same device can be accessed using >> device mapper and using physical volume /dev/sd*. If you create >> integrity tags at device ma

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-07 Thread Martin K. Petersen
Mikulas, > If you create the integrity tag at or above device mapper level, you > will run into problems because the same device can be accessed using > device mapper and using physical volume /dev/sd*. If you create > integrity tags at device mapper level, they will contain device > mapper's log

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-06 Thread Mikulas Patocka
On Sat, 5 Aug 2017, Martin K. Petersen wrote: > Mikulas, > > > The sector number in the integrity tag must match the physical sector > > number. So, it must be verified at the bottom. > > The ref tag seed matches the submitter block number (typically block > layer sector for the top device) a

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-05 Thread Martin K. Petersen
Mikulas, > The sector number in the integrity tag must match the physical sector > number. So, it must be verified at the bottom. The ref tag seed matches the submitter block number (typically block layer sector for the top device) and is remapped to and from the LBA by the SCSI disk driver or

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-05 Thread Martin K. Petersen
Christoph, > We can simply add another bio flag to get back to the previous > behavior. That being said thing to do in the end is to verify it > at the top of the stack, and not the bottom eventuall. I can cook > up a patch for that. Yeah, the original code was careful about only adding the ve

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-05 Thread Mikulas Patocka
On Sat, 5 Aug 2017, Christoph Hellwig wrote: > > On Thu, Aug 03, 2017 at 10:10:55AM -0400, Mikulas Patocka wrote: > > That dm-crypt commit that uses bio integrity payload came 3 months before > > 7c20f11680a441df09de7235206f70115fbf6290 and it was already present in > > 4.12. > > And on it's

Re: [dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-05 Thread Christoph Hellwig
On Thu, Aug 03, 2017 at 10:10:55AM -0400, Mikulas Patocka wrote: > That dm-crypt commit that uses bio integrity payload came 3 months before > 7c20f11680a441df09de7235206f70115fbf6290 and it was already present in > 4.12. And on it's own that isn't an argument if your usage is indeed wrong, and

[dm-devel] [PATCH] bio-integrity: revert "stop abusing bi_end_io"

2017-08-03 Thread Mikulas Patocka
On Wed, 2 Aug 2017, Christoph Hellwig wrote: > On Wed, Aug 02, 2017 at 02:27:50PM +0200, Milan Broz wrote: > > In dm-integrity target we register integrity profile that have > > both generate_fn and verify_fn callbacks set to NULL. > > > > This is used if dm-integrity is stacked under a dm-cryp