|
|
b7f731 |
From 758b327cf5a7aab50ae5c70ecbc371dc4f715bb6 Mon Sep 17 00:00:00 2001
|
|
|
b7f731 |
From: Jes Sorensen <jes@wobbly.dhcp.thefacebook.com>
|
|
|
b7f731 |
Date: Thu, 30 Mar 2017 10:39:29 -0400
|
|
|
b7f731 |
Subject: [RHEL7.5 PATCH 042/169] Grow: Remove unnecessary optimization
|
|
|
b7f731 |
|
|
|
b7f731 |
Per explanation by Neil, this optimization of writing "size" to the
|
|
|
b7f731 |
attribute of each device, however when reducing the size of devices,
|
|
|
b7f731 |
the size change isn't permitted until the array has been shrunk, so
|
|
|
b7f731 |
this will fail anyway.
|
|
|
b7f731 |
|
|
|
b7f731 |
This effectively reverts 65a9798b58b4e4de0157043e2b30a738c27eff43
|
|
|
b7f731 |
|
|
|
b7f731 |
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
|
|
|
b7f731 |
---
|
|
|
b7f731 |
Grow.c | 12 ------------
|
|
|
b7f731 |
1 file changed, 12 deletions(-)
|
|
|
b7f731 |
|
|
|
b7f731 |
diff --git a/Grow.c b/Grow.c
|
|
|
b7f731 |
index af8d520..0d551ce 100755
|
|
|
b7f731 |
--- a/Grow.c
|
|
|
b7f731 |
+++ b/Grow.c
|
|
|
b7f731 |
@@ -1982,15 +1982,7 @@ int Grow_reshape(char *devname, int fd,
|
|
|
b7f731 |
* understands '0' to mean 'max'.
|
|
|
b7f731 |
*/
|
|
|
b7f731 |
min_csize = 0;
|
|
|
b7f731 |
- rv = 0;
|
|
|
b7f731 |
for (mdi = sra->devs; mdi; mdi = mdi->next) {
|
|
|
b7f731 |
- if (sysfs_set_num(sra, mdi, "size",
|
|
|
b7f731 |
- s->size == MAX_SIZE ? 0 : s->size) < 0) {
|
|
|
b7f731 |
- /* Probably kernel refusing to let us
|
|
|
b7f731 |
- * reduce the size - not an error.
|
|
|
b7f731 |
- */
|
|
|
b7f731 |
- break;
|
|
|
b7f731 |
- }
|
|
|
b7f731 |
if (array.not_persistent == 0 &&
|
|
|
b7f731 |
array.major_version == 0 &&
|
|
|
b7f731 |
get_linux_version() < 3001000) {
|
|
|
b7f731 |
@@ -2005,10 +1997,6 @@ int Grow_reshape(char *devname, int fd,
|
|
|
b7f731 |
}
|
|
|
b7f731 |
}
|
|
|
b7f731 |
}
|
|
|
b7f731 |
- if (rv) {
|
|
|
b7f731 |
- pr_err("Cannot set size on array members.\n");
|
|
|
b7f731 |
- goto size_change_error;
|
|
|
b7f731 |
- }
|
|
|
b7f731 |
if (min_csize && s->size > min_csize) {
|
|
|
b7f731 |
pr_err("Cannot safely make this array use more than 2TB per device on this kernel.\n");
|
|
|
b7f731 |
rv = 1;
|
|
|
b7f731 |
--
|
|
|
b7f731 |
2.7.4
|
|
|
b7f731 |
|