[PATCH 2/4] FIX: Get spares from external metadata

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

 



For external metadata cases, information about number of spares cannot
be get via ioctl GET_ARRAY_INFO for particular array
(as info variable is initialized by). In md this information is present
in container object not array one.
This causes need to get spare disks number from external metadata.

This information is required for reshape_array() function to decide
if spare disks number satisfy operation requirements.

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

 Grow.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/Grow.c b/Grow.c
index 9ae2ecd..08fc258 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1573,6 +1573,19 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
 				       force, backup_file, quiet);
 		frozen = 0;
 	} else {
+		/* get spare devices from external metadata
+		 */
+		if (st->ss->external) {
+			struct mdinfo *info2;
+
+			info2 = st->ss->container_content(st, subarray);
+			if (info2) {
+				info.array.spare_disks =
+					info2->array.spare_disks;
+				sysfs_free(info2);
+			}
+		}
+
 		/* Impose these changes on a single array.  First
 		 * check that the metadata is OK with the change. */
 

--
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