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-25-2010, 08:48 PM
Benjamin Marzinski
 
Default multipath: fix offset for containted slices.

For contained slices, the offset of the new device should be from the start
of the containing device, which is what you are creating the new device on top
of. It should not be the offset from the start of the entire disk.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
:100644 100644 b61a81f... 103ed0a... M kpartx/kpartx.c
kpartx/kpartx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Index: multipath-tools-100322/kpartx/kpartx.c
================================================== =================
--- multipath-tools-100322.orig/kpartx/kpartx.c
+++ multipath-tools-100322/kpartx/kpartx.c
@@ -488,6 +488,7 @@ main(int argc, char **argv){
d = c;
while (c) {
for (j = 0; j < n; j++) {
+ uint64_t start;
int k = slices[j].container - 1;

if (slices[j].size == 0)
@@ -498,7 +499,7 @@ main(int argc, char **argv){
continue;

/* Skip all simple slices */
- if (k < 0)
+ if (slices[j].container == 0)
continue;

/* Check container slice */
@@ -513,10 +514,11 @@ main(int argc, char **argv){
}
strip_slash(partname);

+ start = slices[j].start - slices[k].start;
if (safe_sprintf(params, "%d:%d %" PRIu64,
slices[k].major,
slices[k].minor,
- slices[j].start)) {
+ start)) {
fprintf(stderr, "params too small
");
exit(1);
}

--
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 04:23 PM.

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