[sheepdog] [PATCH] sheep: check whether there is a pending recovery correctly

MORITA Kazutaka morita.kazutaka at gmail.com
Fri May 10 16:59:15 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

Comparing current_rinfo->epoch and sys->epoch is not enough because sheep may
start recovery without incrementing sys->epoch (e.g. unplugging a md disk).
Checking next_rinfo is correct and more straightforward.

This fixes an error of tests/056.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/recovery.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 4c85a08..7876935 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -337,7 +337,7 @@ bool oid_in_recovery(uint64_t oid)
 		return false;
 	}
 
-	if (before(rinfo->epoch, sys->epoch))
+	if (uatomic_read(&next_rinfo))
 		return true;
 
 	/* If we are in preparation of object list, oid is not recovered yet */
-- 
1.7.9.5




More information about the sheepdog mailing list