[Sheepdog] [PATCH 5/6] collie: fix collie starting with empty epoch directory

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue May 4 21:20:09 CEST 2010


If the empty epoch directory is already in the store directory, collie
fails to start up without much information.  This occurs, for example,
when we stop collies before executing mkfs.  This patch continues
starting up in the such case.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 collie/store.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/collie/store.c b/collie/store.c
index 956d28a..f76e40b 100644
--- a/collie/store.c
+++ b/collie/store.c
@@ -1663,6 +1663,10 @@ static int init_epoch_path(char *base_path)
 
 	dir = opendir(path);
 	if (!dir) {
+		if (errno == ENOENT)
+			/* probably, sheepdog is not formatted yet  */
+			return 0;
+
 		fprintf(stderr, "failed to open the epoch dir %s, %m\n", path);
 		return SD_RES_EIO;
 	}
-- 
1.5.6.5




More information about the sheepdog mailing list