From: Christoph Hellwig <hch@lst.de>
To: Anuj Gupta <anuj20.g@samsung.com>
Cc: axboe@kernel.dk, hch@lst.de, kbusch@kernel.org,
linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
martin.petersen@oracle.com, Kanchan Joshi <joshi.k@samsung.com>
Subject: Re: [PATCH v2] block: unmap and free user mapped integrity via submitter
Date: Mon, 20 May 2024 17:49:43 +0200 [thread overview]
Message-ID: <20240520154943.GA1327@lst.de> (raw)
In-Reply-To: <20240513084222.8577-1-anuj20.g@samsung.com>
> diff --git a/block/bio-integrity.c b/block/bio-integrity.c
> index 2e3e8e04961e..8b528e12136f 100644
> --- a/block/bio-integrity.c
> +++ b/block/bio-integrity.c
> @@ -144,16 +144,38 @@ void bio_integrity_free(struct bio *bio)
> struct bio_integrity_payload *bip = bio_integrity(bio);
> struct bio_set *bs = bio->bi_pool;
>
> + if (bip->bip_flags & BIP_INTEGRITY_USER)
> + return;
> if (bip->bip_flags & BIP_BLOCK_INTEGRITY)
> kfree(bvec_virt(bip->bip_vec));
> - else if (bip->bip_flags & BIP_INTEGRITY_USER)
> - bio_integrity_unmap_user(bip);
>
> __bio_integrity_free(bs, bip);
> bio->bi_integrity = NULL;
> bio->bi_opf &= ~REQ_INTEGRITY;
This looks correct. I wish we could go one step further (maybe
in a separate patch/series) to also move freeing the bio integrity
data to the callers. In fact I wonder if there is any point in
doing this early separate free vs just doing it as part of the
final bio put. With that we could also entirely remove the
BIP_INTEGRITY_USER flag.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2024-05-20 15:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240513084939epcas5p4530be8e7fc62b8d4db694d6b5bca3a19@epcas5p4.samsung.com>
2024-05-13 8:42 ` [PATCH v2] block: unmap and free user mapped integrity via submitter Anuj Gupta
2024-05-20 15:49 ` Christoph Hellwig [this message]
2024-05-24 10:19 ` Kanchan Joshi
2024-06-03 16:37 ` Anuj gupta
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=20240520154943.GA1327@lst.de \
--to=hch@lst.de \
--cc=anuj20.g@samsung.com \
--cc=axboe@kernel.dk \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=martin.petersen@oracle.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