diff mbox

[2/7] dm core: add integrity feature to request-based dm

Message ID 49F174A8.1010703@ct.jp.nec.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Kiyoshi Ueda April 24, 2009, 8:13 a.m. UTC
This patch clones integrity payload in request-based dm code path.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Alasdair G Kergon <agk@redhat.com>
---
 drivers/md/dm.c |    8 ++++++++
 1 file changed, 8 insertions(+)


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Comments

Hannes Reinecke April 24, 2009, 8:46 a.m. UTC | #1
Kiyoshi Ueda wrote:
> This patch clones integrity payload in request-based dm code path.
> 
> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Acked-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox

Patch

Index: 2.6.30-rc3/drivers/md/dm.c
===================================================================
--- 2.6.30-rc3.orig/drivers/md/dm.c
+++ 2.6.30-rc3/drivers/md/dm.c
@@ -1375,6 +1375,14 @@  static int clone_request_bios(struct req
 		}
 
 		__bio_clone(clone_bio, bio);
+
+		if (bio_integrity(bio) &&
+		    !bio_integrity_clone(clone_bio, bio, GFP_ATOMIC)) {
+			bio_free(clone_bio, md->bs);
+			free_bio_info(md, info);
+			goto free_and_out;
+		}
+
 		clone_bio->bi_destructor = dm_bio_destructor;
 		clone_bio->bi_end_io = end_clone_bio;
 		info->rq = clone;