From: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp>

Now we have a stale object with an appropriate suffix, so no need to try to read
from the newer epoch.

Signed-off-by: MORITA Kazutaka <morita.kazut...@lab.ntt.co.jp>
---
 sheep/plain_store.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index 7e8eb9c..05f96eb 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -255,7 +255,6 @@ int default_read(uint64_t oid, const struct siocb *iocb)
 {
        int ret;
        char path[PATH_MAX];
-       uint32_t epoch = sys_epoch();
 
        get_obj_path(oid, path);
        ret = default_read_from_path(oid, path, iocb);
@@ -264,9 +263,8 @@ int default_read(uint64_t oid, const struct siocb *iocb)
         * If the request is againt the older epoch, try to read from
         * the stale directory
         */
-       while (ret == SD_RES_NO_OBJ && iocb->epoch < epoch) {
-               epoch--;
-               get_stale_obj_path(oid, epoch, path);
+       if (ret == SD_RES_NO_OBJ && iocb->epoch < sys_epoch()) {
+               get_stale_obj_path(oid, iocb->epoch, path);
                ret = default_read_from_path(oid, path, iocb);
        }
 
-- 
1.7.9.5

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

Reply via email to