[sheepdog] [PATCH] sheep: open files with O_EXCL when creating objects

Liu Yuan namei.unix at gmail.com
Fri Sep 14 11:35:54 CEST 2012


On 09/13/2012 05:30 PM, MORITA Kazutaka wrote:
> There is a race condition in default_create_and_write_obj because if
> node membership changes during object creation, gateway and recovery
> process could send CREATE operations to the same object at the same
> time.  This causes, for example, the following problem.
> 
>   1. gateway request creates a tmp_path file
>   2. recovery process also creates the same tmp_path file
>   3. gateway request renames the tmp_path to a correct path
>   4. recovery process also tries to rename, but it fails because the
>      tmp_path doesn't exist
> 
> To avoid this problem, this patch uses a O_EXCL option to create
> objects.

Applied, thanks.

Yuan



More information about the sheepdog mailing list