All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Keith Busch <kbusch@meta.com>
Cc: <linux-block@vger.kernel.org>, <hch@lst.de>,
	<linux-nvme@lists.infradead.org>, Keith Busch <kbusch@kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCHv2] block: always allocate integrity buffer
Date: Wed, 07 May 2025 18:31:33 -0400	[thread overview]
Message-ID: <yq1msbot6ox.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20250507191424.2436350-1-kbusch@meta.com> (Keith Busch's message of "Wed, 7 May 2025 12:14:24 -0700")


Keith,

> +	if (bio_op(bio) == REQ_OP_READ && !bio->bi_status &&
> +	    bip->bip_flags & BIP_CHECK_GUARD) {

> -	if (bio_data_dir(bio) == WRITE)
> +	if (bio_data_dir(bio) == WRITE && bid->bip.bip_flags & BIP_CHECK_GUARD)
>  		blk_integrity_generate(bio);

I know that we can't have one without the other currently but there's
some cognitive PI dissonance wrt. keying off BIP_CHECK_GUARD only.

Maybe worth considering:

#define BIP_CHECK_FLAGS (BIP_CHECK_GUARD | BIP_CHECK_REFTAG | BIP_CHECK_APPTAG)

and validating against that? Or a bip_should_check() wrapper.

Not a biggie, it just trips me up when we encode implementation-specific
assumptions.

Anyway. It's probably OK.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen

  reply	other threads:[~2025-05-07 22:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 19:14 [PATCHv2] block: always allocate integrity buffer Keith Busch
2025-05-07 22:31 ` Martin K. Petersen [this message]
2025-05-08  5:15   ` Christoph Hellwig
2025-05-08  5:12 ` Christoph Hellwig
2025-05-08 16:14   ` Keith Busch
2025-05-08 16:19     ` Christoph Hellwig

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=yq1msbot6ox.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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.