From: Milan Broz <gmazyland@gmail.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
"Ivanov, Dmitry (HPC)" <dmitry.ivanov2@hpe.com>
Cc: Jens Axboe <axboe@kernel.dk>,
Damien Le Moal <damien.lemoal@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Dmitry Fomichev <dmitry.fomichev@wdc.com>,
Mike Snitzer <snitzer@redhat.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
device-mapper development <dm-devel@redhat.com>,
Mikulas Patocka <mpatocka@redhat.com>,
"Lyashkov, Alexey" <alexey.lyashkov@hpe.com>
Subject: Re: [dm-devel] [PATCH 0/1] t10-pi bio split fix
Date: Fri, 4 Feb 2022 08:43:58 +0100 [thread overview]
Message-ID: <e033bbdf-5c07-8085-030d-a9954b321f08@gmail.com> (raw)
In-Reply-To: <yq1tudfz49v.fsf@ca-mkp.ca.oracle.com>
On 04/02/2022 04:44, Martin K. Petersen wrote:
>
> Dmitry,
>
>> My only concern is dm_crypt target which operates on bip_iter directly
>> with the code copy-pasted from bio_integrity_advance:
>>
>> static int dm_crypt_integrity_io_alloc(struct dm_crypt_io *io, struct bio *bio)
>> {
>> struct bio_integrity_payload *bip;
>> unsigned int tag_len;
>> int ret;
>>
>> if (!bio_sectors(bio) || !io->cc->on_disk_tag_size)
>> return 0;
>>
>> bip = bio_integrity_alloc(bio, GFP_NOIO, 1);
>> if (IS_ERR(bip))
>> return PTR_ERR(bip);
>>
>> tag_len = io->cc->on_disk_tag_size * (bio_sectors(bio) >> io->cc->sector_shift);
>>
>> bip->bip_iter.bi_size = tag_len;
>> bip->bip_iter.bi_sector = io->cc->start + io->sector;
>> ^^^
>>
>> ret = bio_integrity_add_page(bio, virt_to_page(io->integrity_metadata),
>> tag_len, offset_in_page(io->integrity_metadata));
>> ...
>> }
>
> I copied Milan and Mike who are more familiar with the dm-drypt internals.
Hi,
What's the problem here you are trying to fix?
Even if I read linux-block posts, I do not understand the context...
Anyway, cc to Mikulas and dm-devel, as dm-integrity/dm-crypt is
the major user of bio_integrity here.
If you touch the code, please be sure you run cryptsetup testsuite
with the integrity tests.
(IOW integritysetup tests and LUKS2 with authenticated encryption
that uses dm-crypt over dm-integrity.)
All we need is that dm-integrity can process bio integrity data
directly. (I know some people do not like it, but this was
the most "elegant" solution here.)
Here dm-crypt uses the data for authenticated encryption (additional
auth tag in bio field), so because dm-crypt owns bio, integrity data
must be allocated in dm-crypt (stacked over dm-integrity).
Milan
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
WARNING: multiple messages have this Message-ID (diff)
From: Milan Broz <gmazyland@gmail.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
"Ivanov, Dmitry (HPC)" <dmitry.ivanov2@hpe.com>
Cc: Damien Le Moal <damien.lemoal@wdc.com>,
Jens Axboe <axboe@kernel.dk>,
Bart Van Assche <bvanassche@acm.org>,
"Lyashkov, Alexey" <alexey.lyashkov@hpe.com>,
Dmitry Fomichev <dmitry.fomichev@wdc.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Mike Snitzer <snitzer@redhat.com>,
Mikulas Patocka <mpatocka@redhat.com>,
device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH 0/1] t10-pi bio split fix
Date: Fri, 4 Feb 2022 08:43:58 +0100 [thread overview]
Message-ID: <e033bbdf-5c07-8085-030d-a9954b321f08@gmail.com> (raw)
In-Reply-To: <yq1tudfz49v.fsf@ca-mkp.ca.oracle.com>
On 04/02/2022 04:44, Martin K. Petersen wrote:
>
> Dmitry,
>
>> My only concern is dm_crypt target which operates on bip_iter directly
>> with the code copy-pasted from bio_integrity_advance:
>>
>> static int dm_crypt_integrity_io_alloc(struct dm_crypt_io *io, struct bio *bio)
>> {
>> struct bio_integrity_payload *bip;
>> unsigned int tag_len;
>> int ret;
>>
>> if (!bio_sectors(bio) || !io->cc->on_disk_tag_size)
>> return 0;
>>
>> bip = bio_integrity_alloc(bio, GFP_NOIO, 1);
>> if (IS_ERR(bip))
>> return PTR_ERR(bip);
>>
>> tag_len = io->cc->on_disk_tag_size * (bio_sectors(bio) >> io->cc->sector_shift);
>>
>> bip->bip_iter.bi_size = tag_len;
>> bip->bip_iter.bi_sector = io->cc->start + io->sector;
>> ^^^
>>
>> ret = bio_integrity_add_page(bio, virt_to_page(io->integrity_metadata),
>> tag_len, offset_in_page(io->integrity_metadata));
>> ...
>> }
>
> I copied Milan and Mike who are more familiar with the dm-drypt internals.
Hi,
What's the problem here you are trying to fix?
Even if I read linux-block posts, I do not understand the context...
Anyway, cc to Mikulas and dm-devel, as dm-integrity/dm-crypt is
the major user of bio_integrity here.
If you touch the code, please be sure you run cryptsetup testsuite
with the integrity tests.
(IOW integritysetup tests and LUKS2 with authenticated encryption
that uses dm-crypt over dm-integrity.)
All we need is that dm-integrity can process bio integrity data
directly. (I know some people do not like it, but this was
the most "elegant" solution here.)
Here dm-crypt uses the data for authenticated encryption (additional
auth tag in bio field), so because dm-crypt owns bio, integrity data
must be allocated in dm-crypt (stacked over dm-integrity).
Milan
next prev parent reply other threads:[~2022-02-04 7:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-02 17:42 [PATCH 0/1] t10-pi bio split fix Ivanov, Dmitry (HPC)
2022-02-04 3:44 ` Martin K. Petersen
2022-02-04 7:43 ` Milan Broz [this message]
2022-02-04 7:43 ` Milan Broz
2022-02-04 7:58 ` [dm-devel] " Lyashkov, Alexey
2022-02-04 7:58 ` Lyashkov, Alexey
2022-02-05 3:03 ` [dm-devel] " Ivanov, Dmitry (HPC)
2022-02-05 3:03 ` Ivanov, Dmitry (HPC)
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=e033bbdf-5c07-8085-030d-a9954b321f08@gmail.com \
--to=gmazyland@gmail.com \
--cc=alexey.lyashkov@hpe.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=damien.lemoal@wdc.com \
--cc=dm-devel@redhat.com \
--cc=dmitry.fomichev@wdc.com \
--cc=dmitry.ivanov2@hpe.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpatocka@redhat.com \
--cc=snitzer@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.