[PATCH 2/5] FIX: Set new raid disks when delta_disks is valid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Possible problem)
When delta_disks is not equal to 0, and is not UnSet (INT_MAX)
new raid disks can be set. Especially in second case passed value
can cause an error in array configuration.

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
---

 sysfs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sysfs.c b/sysfs.c
index a7dfcc2..571eab5 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -575,7 +575,9 @@ int sysfs_set_array(struct mdinfo *info, int vers)
 				    info->reshape_progress);
 		rv |= sysfs_set_num(info, NULL, "chunk_size", info->new_chunk);
 		rv |= sysfs_set_num(info, NULL, "layout", info->new_layout);
-		rv |= sysfs_set_num(info, NULL, "raid_disks",
+		if ((info->delta_disks != 0) &&
+		    (info->delta_disks != UnSet))
+			rv |= sysfs_set_num(info, NULL, "raid_disks",
 				    info->array.raid_disks + info->delta_disks);
 		/* We don't set 'new_level' here.  That can only happen
 		 * once the reshape completes.

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux