From d88854f08961d26f3a63cfae7972188d26a128e4 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Thu, 7 Jul 2005 17:59:34 -0700 Subject: [PATCH] [PATCH] device-mapper: dm-raid1: Limit bios to size of mirror region Set the target's split_io field when building a dm-mirror device so incoming bios won't span the mirror's internal regions. Without this, regions can be accessed while not holding correct locks and data corruption is possible. Reported-By: "Zhao Qian" From: Kevin Corry Signed-Off-By: Alasdair G Kergon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/dm-raid1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 6e3cf7e13451..12031c9d3f1e 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -1060,6 +1060,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) } ti->private = ms; + ti->split_io = ms->rh.region_size; r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client); if (r) { -- 2.11.4.GIT