Преглед на файлове

[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" <zhaoqian@aaastor.com>
From: Kevin Corry <kevcorry@us.ibm.com>
Signed-Off-By: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alasdair G Kergon преди 20 години
родител
ревизия
d88854f089
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      drivers/md/dm-raid1.c

+ 1 - 0
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) {