[sheepdog] [PATCH 2/2] sheep: save config before logging current epoch
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Fri Aug 31 09:34:42 CEST 2012
If sheep exits after writing epoch info and before saving config in
cluster_make_fs(), it will send a wrong config to master and fail to
join Sheepdog when it restarts.
This patch saves config before logging epoch info to avoid the
problem.
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
sheep/ops.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sheep/ops.c b/sheep/ops.c
index 74504a8..b4fa77f 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -248,6 +248,8 @@ static int cluster_make_fs(const struct sd_req *req, struct sd_rsp *rsp,
created_time = hdr->ctime;
set_cluster_ctime(created_time);
+ set_cluster_copies(sys->nr_copies);
+ set_cluster_flags(sys->flags);
for (i = 1; i <= latest_epoch; i++)
remove_epoch(i);
@@ -261,8 +263,6 @@ static int cluster_make_fs(const struct sd_req *req, struct sd_rsp *rsp,
if (ret)
return SD_RES_EIO;
- set_cluster_copies(sys->nr_copies);
- set_cluster_flags(sys->flags);
if (have_enough_zones())
sys->status = SD_STATUS_OK;
else
--
1.7.2.5
More information about the sheepdog
mailing list