[PATCH 1/8] FIX: put update in to queue for local meta update

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

 



When mdmon is not active (raid0 case) update has to be applied locally by mdadm.
In such case during append_metadata_update() update_tail doesn't exist
and update can be directly put in to update for local processing.

After this reshape_super() can directly call prepare_update() and process_update()
to update anchor in the same way as mdmon does it. space list cleanup is required only.
sync_metadata() writes metadata to array (by mdadm)

When mdmon exists, local update is applied but not flushed to array, it is sent to mdmon
and from mdmon update is flushed to disk. This allows us to avoid anchor reloading.

It is recommended to use local updates in mdadm (without anchor reload) with mdmon blocked/array frozen/.
This makes us sure that there is no other changes that should be taken under consideration
during processing in mdadm.

For local updates single update queue is supported.

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

 Grow.c |    7 ++++++-
 util.c |   10 ++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Grow.c b/Grow.c
index 898eb3e..c2e84f3 100644
--- a/Grow.c
+++ b/Grow.c
@@ -591,8 +591,13 @@ static void sync_metadata(struct supertype *st)
 		if (st->update_tail) {
 			flush_metadata_updates(st);
 			st->update_tail = &st->updates;
-		} else
+		} else {
 			st->ss->sync_metadata(st);
+			if (st->updates) {
+				free(st->updates);
+				st->updates = NULL;
+			}
+		}
 	}
 }
 
diff --git a/util.c b/util.c
index 10d2140..9e3f13f 100644
--- a/util.c
+++ b/util.c
@@ -1889,8 +1889,14 @@ void append_metadata_update(struct supertype *st, void *buf, int len)
 	mu->space = NULL;
 	mu->space_list = NULL;
 	mu->next = NULL;
-	*st->update_tail = mu;
-	st->update_tail = &mu->next;
+	if (st->update_tail) {
+		*st->update_tail = mu;
+		st->update_tail = &mu->next;
+	} else {
+		if (st->updates)
+			free(st->updates);
+		st->updates = mu;
+	}
 }
 #endif /* MDASSEMBLE */
 

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