[Sheepdog] [PATCH] fix a bug in get_store_dir() which gives a bad directory for simple store

Liu Yuan namei.unix at gmail.com
Wed May 2 04:54:17 CEST 2012


On 05/01/2012 09:26 PM, Li Wenpeng wrote:

> From: levin li <xingke.lwp at taobao.com>
> 
> For simple store, it gives a directory for the object
> such as
> /home/levin/disk/store/2/obj/00000001007c2b2500000002
> 
> but in fact it should be
> /home/levin/disk/store/2/obj/00000001/007c2b2500000002
> 
> This bug may cause sheep fail to remove data objects
> 
> Signed-off-by: levin li <xingke.lwp at taobao.com>
> ---
>  sheep/ops.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sheep/ops.c b/sheep/ops.c
> index 8d1ac03..27351af 100644
> --- a/sheep/ops.c
> +++ b/sheep/ops.c
> @@ -68,7 +68,7 @@ struct flush_work {
>  static void get_store_dir(struct strbuf *buf, int epoch)
>  {
>  	if (!strcmp(sd_store->name, "simple"))
> -		strbuf_addf(buf, "%s%08u", obj_path, epoch);
> +		strbuf_addf(buf, "%s%08u/", obj_path, epoch);
>  	else /* XXX assume other store doesn't need epoch/obj pattern */
>  		strbuf_addf(buf, "%s", obj_path);
>  }


Applied. thanks

Yuan



More information about the sheepdog mailing list