From: NeilBrown Date: Thu, 4 Oct 2012 06:34:21 +0000 (+1000) Subject: Grow: set new_data_offset if appropriate X-Git-Tag: mdadm-3.3-rc1~194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe384ca0b90e4e8e18f705aacbf031ea76d9c604;p=thirdparty%2Fmdadm.git Grow: set new_data_offset if appropriate --- diff --git a/mdadm.h b/mdadm.h index 1f4f23bf..b808739a 100644 --- a/mdadm.h +++ b/mdadm.h @@ -188,6 +188,7 @@ struct mdinfo { int uuid[4]; char name[33]; unsigned long long data_offset; + unsigned long long new_data_offset; unsigned long long component_size; /* same as array.size, except in * sectors and up to 64bits. */ diff --git a/sysfs.c b/sysfs.c index 47294556..a7ff38a4 100644 --- a/sysfs.c +++ b/sysfs.c @@ -302,6 +302,11 @@ struct mdinfo *sysfs_read(int fd, int devnum, unsigned long options) if (load_sys(fname, buf)) goto abort; dev->data_offset = strtoull(buf, NULL, 0); + strcpy(dbase, "new_offset"); + if (load_sys(fname, buf) == 0) + dev->new_data_offset = strtoull(buf, NULL, 0); + else + dev->new_data_offset = dev->data_offset; } if (options & GET_SIZE) { strcpy(dbase, "size");