]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
imsm: reading of UEFI variables needs an update
[thirdparty/mdadm.git] / super1.c
index 9299322fff9c4844a440c5619059619b1ceb51df..79bb4d0cdcaf10c2dd95840e283e4f06eb7983af 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -698,6 +698,20 @@ static int update_super1(struct supertype *st, struct mdinfo *info,
                        sb->dev_roles[d] = __cpu_to_le16(want);
                        rv = 1;
                }
+               if (info->reshape_active &&
+                   sb->feature_map & __le32_to_cpu(MD_FEATURE_RESHAPE_ACTIVE) &&
+                   info->delta_disks >= 0 &&
+                   info->reshape_progress < __le64_to_cpu(sb->reshape_position)) {
+                       sb->reshape_position = __cpu_to_le64(info->reshape_progress);
+                       rv = 1;
+               }
+               if (info->reshape_active &&
+                   sb->feature_map & __le32_to_cpu(MD_FEATURE_RESHAPE_ACTIVE) &&
+                   info->delta_disks < 0 &&
+                   info->reshape_progress > __le64_to_cpu(sb->reshape_position)) {
+                       sb->reshape_position = __cpu_to_le64(info->reshape_progress);
+                       rv = 1;
+               }
        } else if (strcmp(update, "linear-grow-new") == 0) {
                unsigned int i;
                int rfd, fd;