]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: set new_data_offset if appropriate
authorNeilBrown <neilb@suse.de>
Sun, 20 May 2012 23:42:26 +0000 (09:42 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 20 May 2012 23:42:26 +0000 (09:42 +1000)
mdadm.h
sysfs.c

diff --git a/mdadm.h b/mdadm.h
index 67eb9cef00a2c51cf76e1d6d4f6bebb66edbd665..a70a0054002f1f41fba5bdd65a84378f23f9e715 100644 (file)
--- 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 8e9d0c5a598f054ef8c491da46cd1dc2a3f4e24e..8bb03ca47476f70706a0c236c93fde59997541ea 100644 (file)
--- a/sysfs.c
+++ b/sysfs.c
@@ -307,6 +307,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");