Grow: Remove unnecessary optimization
Per explanation by Neil, this optimization of writing "size" to the
attribute of each device, however when reducing the size of devices,
the size change isn't permitted until the array has been shrunk, so
this will fail anyway.
This effectively reverts 65a9798b58
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
This commit is contained in:
parent
b0ba6a1dee
commit
758b327cf5
12
Grow.c
12
Grow.c
|
@ -1982,15 +1982,7 @@ int Grow_reshape(char *devname, int fd,
|
|||
* understands '0' to mean 'max'.
|
||||
*/
|
||||
min_csize = 0;
|
||||
rv = 0;
|
||||
for (mdi = sra->devs; mdi; mdi = mdi->next) {
|
||||
if (sysfs_set_num(sra, mdi, "size",
|
||||
s->size == MAX_SIZE ? 0 : s->size) < 0) {
|
||||
/* Probably kernel refusing to let us
|
||||
* reduce the size - not an error.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
if (array.not_persistent == 0 &&
|
||||
array.major_version == 0 &&
|
||||
get_linux_version() < 3001000) {
|
||||
|
@ -2005,10 +1997,6 @@ int Grow_reshape(char *devname, int fd,
|
|||
}
|
||||
}
|
||||
}
|
||||
if (rv) {
|
||||
pr_err("Cannot set size on array members.\n");
|
||||
goto size_change_error;
|
||||
}
|
||||
if (min_csize && s->size > min_csize) {
|
||||
pr_err("Cannot safely make this array use more than 2TB per device on this kernel.\n");
|
||||
rv = 1;
|
||||
|
|
Loading…
Reference in New Issue