Skip to content

Commit

Permalink
[PATCH] device-mapper: dm-raid1: Limit bios to size of mirror region
Browse files Browse the repository at this point in the history
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" <[email protected]>
From: Kevin Corry <[email protected]>
Signed-Off-By: Alasdair G Kergon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kergon authored and Linus Torvalds committed Jul 8, 2005
1 parent 374a6cf commit d88854f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d88854f

Please sign in to comment.