NeilBrown: Grow: restore backup to proper location.

Martin F. Krafft madduck at alioth.debian.org
Wed Jan 27 02:01:13 UTC 2010


Module: mdadm
Branch: build
Commit: 92dcdf7c01f142aec85deff9f002e59951952978
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=92dcdf7c01f142aec85deff9f002e59951952978

Author: NeilBrown <neilb at suse.de>
Date:   Fri Nov  6 13:38:43 2009 +1100

Grow: restore backup to proper location.

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 at gmail.com>
Signed-off-by: NeilBrown <neilb at suse.de>

---

 Grow.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Grow.c b/Grow.c
index f367041..deff0e0 100644
--- 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)




More information about the pkg-mdadm-commits mailing list