[PATCH 06/11] imsm: FIX: Restore critical section on degraded array

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

 



When during assembly degradation occurs restoring metadata critical section
fails whole assembly.
Allow for degradation during assembly and not restore data on degraded disk.

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

 super-intel.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 0fc907d..ccd9883 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -7984,6 +7984,10 @@ static void imsm_delete(struct intel_super *super, struct dl **dlp, unsigned ind
 int open_backup_targets(struct mdinfo *info, int raid_disks, int *raid_fds)
 {
 	struct mdinfo *sd;
+	int i;
+
+	for (i = 0; i < raid_disks; i++)
+		raid_fds[i] = -1;
 
 	for (sd = info->devs ; sd ; sd = sd->next) {
 		char *dn;
@@ -8293,7 +8297,11 @@ int recover_backup_imsm(struct supertype *st, struct mdinfo *info)
 	if (!targets)
 		goto abort;
 
-	open_backup_targets(info, new_disks, targets);
+	if (open_backup_targets(info, new_disks, targets)) {
+		fprintf(stderr,
+			Name ": Cannot open devices belongs to array.\n");
+		goto abort;
+	}
 
 	for (i = 0; i < new_disks; i++) {
 		if (targets[i] < 0) {

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