[sheepdog] [PATCH] sheep: init journal file after init_disk_space()

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Apr 18 01:47:51 CEST 2013


When MD is enabled, we have to call journal_file_init() after
init_disk_space().  Otherwise, sheep cannot replay journal entries
correctly since md_disks are setup in md_init_space().

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/sheep.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/sheep/sheep.c b/sheep/sheep.c
index 7ab85f7..0cbf4e9 100644
--- a/sheep/sheep.c
+++ b/sheep/sheep.c
@@ -599,17 +599,6 @@ int main(int argc, char **argv)
 	if (ret)
 		exit(1);
 
-	/* We should init journal file before config file init */
-	if (uatomic_is_true(&sys->use_journal)) {
-		if (!strlen(jpath))
-			/* internal journal */
-			memcpy(jpath, dir, strlen(dir));
-		sd_dprintf("%s, %zu, %d", jpath, jsize, jskip);
-		ret = journal_file_init(jpath, jsize, jskip);
-		if (ret)
-			exit(1);
-	}
-
 	ret = init_config_file();
 	if (ret)
 		exit(1);
@@ -642,6 +631,17 @@ int main(int argc, char **argv)
 		exit(1);
 	}
 
+	/* We should init journal file before backend init */
+	if (uatomic_is_true(&sys->use_journal)) {
+		if (!strlen(jpath))
+			/* internal journal */
+			memcpy(jpath, dir, strlen(dir));
+		sd_dprintf("%s, %zu, %d", jpath, jsize, jskip);
+		ret = journal_file_init(jpath, jsize, jskip);
+		if (ret)
+			exit(1);
+	}
+
 	/*
 	 * After this function, we are multi-threaded.
 	 *
-- 
1.8.1.3.566.gaa39828




More information about the sheepdog mailing list