[sheepdog] [PATCH] sheep: save updated config after version migration

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Jun 9 11:51:45 CEST 2014


Current config migration mechanism doesn't save updated version number
even after successful migration. This patch fixes the problem.

Related issue:
https://bugs.launchpad.net/sheepdog-project/+bug/1327040

Cc: Ruoyu <liangry at ucweb.com>
Cc: Giovanni Bellac <giovannib1979 at ymail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/config.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sheep/config.c b/sheep/config.c
index 3342560..846a802 100644
--- a/sheep/config.c
+++ b/sheep/config.c
@@ -129,16 +129,16 @@ reload:
 		       "exists data format mismatch");
 		return -1;
 	}
-out:
-	close(fd);
 
-	return ret;
 create:
 	config.version = SD_FORMAT_VERSION;
 	if (write_config() != SD_RES_SUCCESS)
 		return -1;
 
-	return 0;
+out:
+	close(fd);
+
+	return ret;
 }
 
 void init_config_path(const char *base_path)
-- 
1.7.1




More information about the sheepdog mailing list