Grow: fix two problems with new_data_offset
1/ ignore failed devices - obviously 2/ We need to tell the kernel which direction the reshape should progress even if we didn't choose the particular data_offset to use. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
a6a78630ac
commit
b397d7f3e0
6
Grow.c
6
Grow.c
|
@ -2267,6 +2267,8 @@ static int set_new_data_offset(struct mdinfo *sra, struct supertype *st,
|
||||||
char *dn = map_dev(sd->disk.major, sd->disk.minor, 0);
|
char *dn = map_dev(sd->disk.major, sd->disk.minor, 0);
|
||||||
unsigned long long new_data_offset;
|
unsigned long long new_data_offset;
|
||||||
|
|
||||||
|
if (sd->disk.state & (1<<MD_DISK_FAULTY))
|
||||||
|
continue;
|
||||||
if (delta_disks < 0) {
|
if (delta_disks < 0) {
|
||||||
/* Don't need any space as array is shrinking
|
/* Don't need any space as array is shrinking
|
||||||
* just move data_offset up by min
|
* just move data_offset up by min
|
||||||
|
@ -2308,9 +2310,9 @@ static int set_new_data_offset(struct mdinfo *sra, struct supertype *st,
|
||||||
dir = -1;
|
dir = -1;
|
||||||
else
|
else
|
||||||
dir = 1;
|
dir = 1;
|
||||||
sysfs_set_str(sra, NULL, "reshape_direction",
|
|
||||||
dir == 1 ? "backwards" : "forwards");
|
|
||||||
}
|
}
|
||||||
|
sysfs_set_str(sra, NULL, "reshape_direction",
|
||||||
|
dir == 1 ? "backwards" : "forwards");
|
||||||
if (dir > 0) {
|
if (dir > 0) {
|
||||||
/* Increase data offset */
|
/* Increase data offset */
|
||||||
if (after < min) {
|
if (after < min) {
|
||||||
|
|
Loading…
Reference in New Issue