[sheepdog] [PATCH] sheep/recovery: don't recover object from stale dir with invalid epoch

Liu Yuan namei.unix at gmail.com
Thu Feb 6 10:08:49 CET 2014


Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/recovery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 0faf71a..5a6d2a5 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -534,7 +534,8 @@ static void recover_object_work(struct work *work)
 
 	/* find object in the stale directory */
 	if (!is_erasure_oid(oid))
-		for (epoch = sys_epoch() - 1; epoch > 0; epoch--) {
+		for (epoch = sys_epoch() - 1; epoch >= last_gathered_epoch;
+		     epoch--) {
 			ret = sd_store->get_hash(oid, epoch, row->local_sha1);
 			if (ret == SD_RES_SUCCESS) {
 				sd_debug("replica found in local at epoch %d",
-- 
1.8.1.2




More information about the sheepdog mailing list