]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: restrict to 2.6.32
authorNeilBrown <neilb@suse.de>
Fri, 6 Nov 2009 04:19:39 +0000 (15:19 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 6 Nov 2009 04:19:39 +0000 (15:19 +1100)
2.6.31 has a bug which can lead to unsafe reshaping.
So only allow a reshape with 2.6.32.
When the required fixed get into 2.6.31.y, this can be relaxed
slightly

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 8e6e7f775403c38721b5dbbcd3aedb3c3d8078d2..4423b787d6147257c14bfa91c91512fbdc0109a8 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -871,6 +871,12 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
                        ndata--;
                }
 
+               if (odata == ndata &&
+                   get_linux_version() < 2006032) {
+                       fprintf(stderr, Name ": in-place reshape is not safe before 2.6.32, sorry.\n");
+                       break;
+               }
+
                /* Check that we can hold all the data */
                size = ndata * array.size;
                get_dev_size(fd, NULL, &array_size);