]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: restore backup to proper location.
authorNeilBrown <neilb@suse.de>
Fri, 6 Nov 2009 02:38:43 +0000 (13:38 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 6 Nov 2009 02:38:43 +0000 (13:38 +1100)
The 'arraystart' is in sectors while restore_stripes requires
bytes, so we need a conversion.

Without this, backups get restored to the wrong offset.

Reported-by: "KueiHuan Chen" <kueihuan.chen@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index f36704191a73650b448169ba5655c4e80c8ce168..deff0e0df697f6d92223a095fb7e75dd85b738b5 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1719,7 +1719,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
                                    info->new_level,
                                    info->new_layout,
                                    fd, __le64_to_cpu(bsb.devstart)*512,
-                                   __le64_to_cpu(bsb.arraystart),
+                                   __le64_to_cpu(bsb.arraystart)*512,
                                    __le64_to_cpu(bsb.length)*512)) {
                        /* didn't succeed, so giveup */
                        if (verbose)
@@ -1736,7 +1736,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
                                    info->new_layout,
                                    fd, __le64_to_cpu(bsb.devstart)*512 +
                                    __le64_to_cpu(bsb.devstart2)*512,
-                                   __le64_to_cpu(bsb.arraystart2),
+                                   __le64_to_cpu(bsb.arraystart2)*512,
                                    __le64_to_cpu(bsb.length2)*512)) {
                        /* didn't succeed, so giveup */
                        if (verbose)