From: Alberto Bertogli <albertito@blitiri.com.ar>
To: linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, Jens Axboe <jens.axboe@oracle.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [RFC PATCH] bio-integrity: Copy bip_buf and bip_size in bio_integrity_clone()
Date: Sun, 24 May 2009 01:20:35 -0300 [thread overview]
Message-ID: <20090524042035.GF1376@blitiri.com.ar> (raw)
Hi!
I'm trying to add bio-integrity support to a device-mapper target I posted
a couple of days ago (http://lkml.org/lkml/2009/5/21/235).
While at it, I found that bio_integrity_clone() does not clone neither bip_buf
nor bip_size, which already copies the bvec, which should have the same data
because it's allocated in bio_integrity_prep().
>From a quick grep, it seems they're only used inside fs/bio-integrity.c, and
through there they get passed to the functions each block device registered
for integrity verification and generation, and used in bio_integrity_tag().
Also, bio_integrity_free() already takes into account that and does not free
bip_buf if it's freeing a cloned bio.
Is there any reason I'm missing why they shouldn't be copied in
bio_integrity_clone(), as illustrated in the following patch?
Thanks a lot,
Alberto
------- 8< ------- 8< ------- 8< ------- 8< ------- 8< ------- 8< -------
From: Alberto Bertogli <albertito@blitiri.com.ar>
Date: Sun, 24 May 2009 01:02:08 -0300
Subject: [PATCH] bio-integrity: Copy bip_buf and bip_size in bio_integrity_clone()
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
---
fs/bio-integrity.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 31c46a2..fa9457d 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -682,6 +682,9 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src, gfp_t gfp_mask)
if (bip == NULL)
return -EIO;
+ bip->bip_buf = bip_src->bip_buf;
+ bip->bip_size = bip_src->bip_size;
+
memcpy(bip->bip_vec, bip_src->bip_vec,
bip_src->bip_vcnt * sizeof(struct bio_vec));
--
1.6.2.2.646.gb214
next reply other threads:[~2009-05-24 4:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-24 4:20 Alberto Bertogli [this message]
2009-05-24 7:16 ` [RFC PATCH] bio-integrity: Copy bip_buf and bip_size in bio_integrity_clone() Alberto Bertogli
2009-05-25 5:04 ` Martin K. Petersen
2009-05-26 2:07 ` Alberto Bertogli
2009-05-26 19:56 ` Martin K. Petersen
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=20090524042035.GF1376@blitiri.com.ar \
--to=albertito@blitiri.com.ar \
--cc=jens.axboe@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).