linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Max Gurtovoy <maxg@mellanox.com>
Cc: linux-block@vger.kernel.org, axboe@kernel.dk,
	martin.petersen@oracle.com, linux-nvme@lists.infradead.org,
	keith.busch@intel.com, hch@lst.de, sagi@grimberg.me,
	shlomin@mellanox.com, israelr@mellanox.com
Subject: Re: [PATCH v2 1/1] block: centralize PI remapping logic to the block layer
Date: Wed, 4 Sep 2019 13:43:48 -0600	[thread overview]
Message-ID: <20190904194347.GH21302@localhost.localdomain> (raw)
In-Reply-To: <1567614452-26251-1-git-send-email-maxg@mellanox.com>

On Wed, Sep 04, 2019 at 07:27:32PM +0300, Max Gurtovoy wrote:
> +	if (blk_integrity_rq(req) && req_op(req) == REQ_OP_READ &&
> +	    error == BLK_STS_OK)
> +		t10_pi_complete(req,
> +			nr_bytes >> blk_integrity_interval_shift(req->q));

This is not created by your patch, but while reviewing it, I noticed
we're corrupting metadata for TYPE0. Even if there's no in-kernel use
for accessing this data, changing it is still wrong.

Perhaps these t10_pi complete/prepare functions should be part of the
integrity profile like generate_fn/verify_fn.

Or as a quicker fix, we could exclude type0 like below:

---
@@ -246,7 +247,8 @@ void t10_pi_complete(struct request *rq, u8 protection_type,
 	u32 ref_tag = t10_pi_ref_tag(rq);
 	struct bio *bio;
 
-	if (protection_type == T10_PI_TYPE3_PROTECTION)
+	if (protection_type == T10_PI_TYPE0_PROTECTION ||
+	    protection_type == T10_PI_TYPE3_PROTECTION)
 		return;
 
 	__rq_for_each_bio(bio, rq) {
-- 
2.14.5

      parent reply	other threads:[~2019-09-04 19:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04 16:27 [PATCH v2 1/1] block: centralize PI remapping logic to the block layer Max Gurtovoy
2019-09-04 17:51 ` Christoph Hellwig
2019-09-04 19:43 ` Keith Busch [this message]

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=20190904194347.GH21302@localhost.localdomain \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=israelr@mellanox.com \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=martin.petersen@oracle.com \
    --cc=maxg@mellanox.com \
    --cc=sagi@grimberg.me \
    --cc=shlomin@mellanox.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;
as well as URLs for NNTP newsgroup(s).