[sheepdog] [PATCH] sheep/recovery: don't recover object from stale dir with invalid epoch
Liu Yuan
namei.unix at gmail.com
Mon Feb 17 08:08:15 CET 2014
On Thu, Feb 06, 2014 at 05:08:49PM +0800, Liu Yuan wrote:
> 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
>
any one give it a review?
Thanks
Yuan
More information about the sheepdog
mailing list