linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [md PATCH 2/5]  md: Enable reshape for external metadata
@ 2010-06-09 14:21 Kwolek, Adam
  2010-06-16  4:53 ` Neil Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Kwolek, Adam @ 2010-06-09 14:21 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid@vger.kernel.org, Williams, Dan J, Ciechanowski, Ed

(md: Online Capacity Expansion for IMSM)
Reshape can't go forward for external metadatas due to fact, that internal md flags are updated during native meta writing. For external metadatas
md_update_sb() is not called (reshape process is blocked).
To take carry about md flags in external metadata array case and allow reshape to roll over, md_update_sb() is called in similar way to native metadata. The difference is that metadata is not stored to disks by md, but externally by mdmon.
---

 drivers/md/md.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c index 9cec771..0a51406 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2065,8 +2065,6 @@ static void md_update_sb(mddev_t * mddev, int force_change)
 	int nospares = 0;
 
 	mddev->utime = get_seconds();
-	if (mddev->external)
-		return;
 repeat:
 	spin_lock_irq(&mddev->write_lock);
 
@@ -2130,11 +2128,16 @@ repeat:
 	/*
 	 * do not write anything to disk if using
 	 * nonpersistent superblocks
+	 * and
+	 * for external meta and reshape
+	 * we can get here also
 	 */
-	if (!mddev->persistent) {
-		if (!mddev->external)
-			clear_bit(MD_CHANGE_PENDING, &mddev->flags);
-
+	if (!mddev->persistent ||
+	    mddev->external) {
+		/* Reshape for external meta
+		 * MD_CHANGE_PENDING has to be cleared also
+		 */
+		clear_bit(MD_CHANGE_PENDING, &mddev->flags);
 		spin_unlock_irq(&mddev->write_lock);
 		wake_up(&mddev->sb_wait);
 		return;
@@ -6895,8 +6898,15 @@ void md_check_recovery(mddev_t *mddev)
 		(mddev->external == 0 && mddev->safemode == 1) ||
 		(mddev->safemode == 2 && ! atomic_read(&mddev->writes_pending)
 		 && !mddev->in_sync && mddev->recovery_cp == MaxSector)
-		))
+		)) {
+
+		/* Reshape for external meta /add disks/
+		 */
+		if ((mddev->external) && (mddev->flags))
+			md_update_sb(mddev, 0);
+
 		return;
+	}
 
 	if (mddev_trylock(mddev)) {
 		int spares = 0;


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-06-17 16:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 14:21 [md PATCH 2/5] md: Enable reshape for external metadata Kwolek, Adam
2010-06-16  4:53 ` Neil Brown
2010-06-16 14:52   ` Kwolek, Adam
2010-06-17  6:11     ` Neil Brown
2010-06-17  9:40       ` Trela, Maciej
2010-06-17 10:35         ` Neil Brown
2010-06-17 13:19           ` Trela, Maciej
2010-06-17 16:49       ` Kwolek, Adam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).