[sheepdog] [PATCH] sheep: some debug output enhancement

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue Jan 7 03:02:15 CET 2014


At Tue,  7 Jan 2014 09:54:34 +0800,
Liu Yuan wrote:
> 
> - do_epoch_log_read() will flood the ERROR message because epoch file not exist
>   but this is a valid case when node have some epoch missing. So change it to
>   sd_debug.
> 
> - enhance md_move_object() for better debug
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  sheep/md.c    | 2 +-
>  sheep/store.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Looks good to me.
Reviewed-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>

Thanks,
Hitoshi

> 
> diff --git a/sheep/md.c b/sheep/md.c
> index 1c065b7..e535454 100644
> --- a/sheep/md.c
> +++ b/sheep/md.c
> @@ -497,7 +497,7 @@ static int md_move_object(uint64_t oid, const char *old, const char *new)
>  
>  	ret = strbuf_read(&buf, fd, sz);
>  	if (ret != sz) {
> -		sd_err("failed to read %s, %d", old, ret);
> +		sd_err("failed to read %s, size %zu, %d, %m", old, sz, ret);
>  		ret = -1;
>  		goto out_close;
>  	}
> diff --git a/sheep/store.c b/sheep/store.c
> index d74be4c..c20b381 100644
> --- a/sheep/store.c
> +++ b/sheep/store.c
> @@ -51,7 +51,7 @@ static int do_epoch_log_read(uint32_t epoch, struct sd_node *nodes, int len,
>  	snprintf(path, sizeof(path), "%s%08u", epoch_path, epoch);
>  	fd = open(path, O_RDONLY);
>  	if (fd < 0) {
> -		sd_err("failed to open epoch %"PRIu32" log, %m", epoch);
> +		sd_debug("failed to open epoch %"PRIu32" log, %m", epoch);
>  		goto err;
>  	}
>  
> -- 
> 1.8.1.2
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list