mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] device-mapper: dm-raid1: Limit bios to size of mirror region
@ 2005-06-30 18:19 Alasdair G Kergon
  2005-07-01  7:26 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Alasdair G Kergon @ 2005-06-30 18:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Kevin Corry, Zhao Qian

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>

--- diff/drivers/md/dm-raid1.c	2005-06-17 20:48:29.000000000 +0100
+++ source/drivers/md/dm-raid1.c	2005-06-29 21:12:13.000000000 +0100
@@ -1060,6 +1060,7 @@
 	}
 
 	ti->private = ms;
+ 	ti->split_io = ms->rh->region_size;
 
 	r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client);
 	if (r) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] device-mapper: dm-raid1: Limit bios to size of mirror region
  2005-06-30 18:19 [PATCH] device-mapper: dm-raid1: Limit bios to size of mirror region Alasdair G Kergon
@ 2005-07-01  7:26 ` Andrew Morton
  2005-07-01 12:56   ` Kevin Corry
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2005-07-01  7:26 UTC (permalink / raw)
  To: Alasdair G Kergon; +Cc: linux-kernel, kevcorry, zhaoqian

Alasdair G Kergon <agk@redhat.com> wrote:
>
> 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>
> 
> --- diff/drivers/md/dm-raid1.c	2005-06-17 20:48:29.000000000 +0100
> +++ source/drivers/md/dm-raid1.c	2005-06-29 21:12:13.000000000 +0100
> @@ -1060,6 +1060,7 @@
>  	}
>  
>  	ti->private = ms;
> + 	ti->split_io = ms->rh->region_size;
>  
>  	r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client);
>  	if (r) {

Ahem.

drivers/md/dm-raid1.c: In function `mirror_ctr':
drivers/md/dm-raid1.c:1072: invalid type argument of `->'

--- devel/drivers/md/dm-raid1.c~device-mapper-dm-raid1-limit-bios-to-size-of-mirror-region-fix	2005-07-01 00:25:26.000000000 -0700
+++ devel-akpm/drivers/md/dm-raid1.c	2005-07-01 00:25:26.000000000 -0700
@@ -1060,7 +1060,7 @@ static int mirror_ctr(struct dm_target *
 	}
 
 	ti->private = ms;
- 	ti->split_io = ms->rh->region_size;
+ 	ti->split_io = ms->rh.region_size;
 
 	r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client);
 	if (r) {

How well tested was this?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] device-mapper: dm-raid1: Limit bios to size of mirror region
  2005-07-01  7:26 ` Andrew Morton
@ 2005-07-01 12:56   ` Kevin Corry
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Corry @ 2005-07-01 12:56 UTC (permalink / raw)
  To: Andrew Morton, zhaoqian; +Cc: Alasdair G Kergon, linux-kernel

On Fri July 1 2005 2:26 am, Andrew Morton wrote:
> Alasdair G Kergon <agk@redhat.com> wrote:
> > --- diff/drivers/md/dm-raid1.c 2005-06-17 20:48:29.000000000 +0100
> > +++ source/drivers/md/dm-raid1.c 2005-06-29 21:12:13.000000000 +0100
> > @@ -1060,6 +1060,7 @@
> >   }
> >
> >   ti->private = ms;
> > +  ti->split_io = ms->rh->region_size;
> >
> >   r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client);
> >   if (r) {
>
> Ahem.
>
> drivers/md/dm-raid1.c: In function `mirror_ctr':
> drivers/md/dm-raid1.c:1072: invalid type argument of `->'
>
> ---
> devel/drivers/md/dm-raid1.c~device-mapper-dm-raid1-limit-bios-to-size-of-mi
>rror-region-fix 2005-07-01 00:25:26.000000000 -0700 +++
> devel-akpm/drivers/md/dm-raid1.c 2005-07-01 00:25:26.000000000 -0700 @@
> -1060,7 +1060,7 @@ static int mirror_ctr(struct dm_target *
>   }
>
>   ti->private = ms;
> -  ti->split_io = ms->rh->region_size;
> +  ti->split_io = ms->rh.region_size;
>
>   r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client);
>   if (r) {
>
> How well tested was this?

Ehh...oops...sorry about that. :(

Zhao, you reported this issue originally. Have you been able to test this yet 
to see if it fixes the corruption problem you were describing? Or can you 
give us a test-case that I can run?

-- 
Kevin Corry
kevcorry@us.ibm.com
http://www.ibm.com/linux/
http://evms.sourceforge.net/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-01 13:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-30 18:19 [PATCH] device-mapper: dm-raid1: Limit bios to size of mirror region Alasdair G Kergon
2005-07-01  7:26 ` Andrew Morton
2005-07-01 12:56   ` Kevin Corry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®