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.kazut...@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

-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to