FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-15-2010, 05:00 AM
Mikulas Patocka
 
Default Iterate both origin and snapshot devices

Iterate both origin and snapshot devices

iterate_devices method should call the callback for all the devices where
the bio may be remapped. Thus, snapshot_iterate_devices should call the callback
for both snapshot and origin underlying devices because it remaps some bios
to the snapshot and some to the origin.

snapshot_iterate_devices called the callback only for the origin device.
This lead to badly calculated device limits if snapshot and origin were placed
on different types of disks.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
drivers/md/dm-snap.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Index: linux-2.6.34-rc1-devel/drivers/md/dm-snap.c
================================================== =================
--- linux-2.6.34-rc1-devel.orig/drivers/md/dm-snap.c 2010-03-12 14:24:39.000000000 +0100
+++ linux-2.6.34-rc1-devel/drivers/md/dm-snap.c 2010-03-12 14:30:30.000000000 +0100
@@ -1899,8 +1899,14 @@ static int snapshot_iterate_devices(stru
iterate_devices_callout_fn fn, void *data)
{
struct dm_snapshot *snap = ti->private;
+ int r;
+
+ r = fn(ti, snap->origin, 0, ti->len, data);

- return fn(ti, snap->origin, 0, ti->len, data);
+ if (!r)
+ r = fn(ti, snap->cow, 0, get_dev_size(snap->cow->bdev), data);
+
+ return r;
}



--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 03-15-2010, 01:14 PM
Mike Snitzer
 
Default Iterate both origin and snapshot devices

On Mon, Mar 15 2010 at 2:00am -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> Iterate both origin and snapshot devices
>
> iterate_devices method should call the callback for all the devices where
> the bio may be remapped. Thus, snapshot_iterate_devices should call the callback
> for both snapshot and origin underlying devices because it remaps some bios
> to the snapshot and some to the origin.
>
> snapshot_iterate_devices called the callback only for the origin device.
> This lead to badly calculated device limits if snapshot and origin were placed
> on different types of disks.
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

Reviewed-by: Mike Snitzer <snitzer@redhat.com>

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

Thread Tools




All times are GMT. The time now is 01:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org