From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>,
"Jiang, Dave" <dave.jiang@intel.com>,
"kbusch@meta.com" <kbusch@meta.com>,
"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>
Cc: "kbusch@kernel.org" <kbusch@kernel.org>
Subject: Re: [PATCH] btt: fix block integrity
Date: Thu, 14 Nov 2024 21:33:05 +0000 [thread overview]
Message-ID: <eb557451f28668a7c8877322a5d5cb954fb6ac32.camel@intel.com> (raw)
In-Reply-To: <20240830204255.4130362-1-kbusch@meta.com>
On Fri, 2024-08-30 at 13:42 -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> bip is NULL before bio_integrity_prep().
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvdimm/btt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
> index 423dcd1909061..13594fb712186 100644
> --- a/drivers/nvdimm/btt.c
> +++ b/drivers/nvdimm/btt.c
> @@ -1435,8 +1435,8 @@ static int btt_do_bvec(struct btt *btt, struct
> bio_integrity_payload *bip,
>
> static void btt_submit_bio(struct bio *bio)
> {
> - struct bio_integrity_payload *bip = bio_integrity(bio);
> struct btt *btt = bio->bi_bdev->bd_disk->private_data;
> + struct bio_integrity_payload *bip;
> struct bvec_iter iter;
> unsigned long start;
> struct bio_vec bvec;
> @@ -1445,6 +1445,7 @@ static void btt_submit_bio(struct bio *bio)
>
> if (!bio_integrity_prep(bio))
> return;
> + bip = bio_integrity(bio);
Hi Keith,
I suspect this isn't actually needed, since the btt never generated its
own protection payload. See the /* Already protected? */ case in
bio_integrity_prep() - I think that's the only case we were trying to
account for - i.e. 'some other layer' set the integrity payload, and
we're just passing it on to it's right spot in pmem, and reading it
back. The btt itself doesn't ever try to generate and set a protection
payload of its own.
If you look at the original flow in
41cd8b70c37ace40077c8d6ec0b74b983178c192, btt never actually wants to
call bio_integrity_prep and allocate the bip - if it has to do that,
that's treated as an error.
Since some of the reworks then to eliminate bio_integrity_enabled, and
other block level changes, this has changed to actually allocating bip
and continuing instead of erroring, but coincidentially since we assign
bip before the allocation (i.e. NULL as you point out), any future
steps nicely ignore it, but if it was set by another subsystem, things
should still 'work' - as in bio_integrity_prep() would return true, and
bip would be non-NULL, and would get written/read as needed, and this
is the happy path.
Does this makes sense or am I missing something?
It's probably irrelevant if we deprecate all of this soon anyway :)
>
> do_acct = blk_queue_io_stat(bio->bi_bdev->bd_disk->queue);
> if (do_acct)
next prev parent reply other threads:[~2024-11-14 21:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 20:42 [PATCH] btt: fix block integrity Keith Busch
2024-09-03 15:47 ` Dave Jiang
2024-11-13 19:03 ` Ira Weiny
2024-11-13 19:21 ` Keith Busch
2024-11-13 21:28 ` Dan Williams
2024-11-13 21:50 ` Jeff Moyer
2024-11-13 22:06 ` Dan Williams
2024-11-14 4:22 ` Christoph Hellwig
2024-11-14 21:33 ` Verma, Vishal L [this message]
2024-11-15 15:19 ` Keith Busch
2024-11-15 17:58 ` Verma, Vishal L
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=eb557451f28668a7c8877322a5d5cb954fb6ac32.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=nvdimm@lists.linux.dev \
/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