[sheepdog] [PATCH 1/2] md: move purge_directory in init_path_space()

MORITA Kazutaka morita.kazutaka at gmail.com
Thu Sep 5 02:23:39 CEST 2013


At Wed,  4 Sep 2013 20:40:55 +0800,
Liu Yuan wrote:
> 
> This also fixes a bug that false-remove .stale for newly plugged disk due to
> commit 882d028
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  sheep/md.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/sheep/md.c b/sheep/md.c
> index 37feeb2..3ce0b15 100644
> --- a/sheep/md.c
> +++ b/sheep/md.c
> @@ -215,7 +215,12 @@ static uint64_t init_path_space(const char *path)
>  	char stale[PATH_MAX];
>  
>  	if (!is_xattr_enabled(path)) {
> -		sd_info("multi-disk support need xattr feature");
> +		sd_err("multi-disk support need xattr feature");
> +		goto broken_path;
> +	}
> +
> +	if (purge_directory(path) < 0) {
> +		sd_err("failed to purge %s", path);
>  		goto broken_path;
>  	}

This looks wrong and cannot pass several functional tests.  We call
init_path_space() when starting up sheep, too.

Thanks,

Kazutaka



More information about the sheepdog mailing list