Re: [PATCH 5/5] rename_ref(): fix a mkdir()/rmdir() race

2013-12-26 Thread Jonathan Nieder
Michael Haggerty wrote: refs.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) A test or example reproduction recipe would be nice. (But I can understand not having one --- races are hard to test.) [...] --- a/refs.c +++ b/refs.c [...] @@ -2574,6 +2575,13 @@ int

[PATCH 5/5] rename_ref(): fix a mkdir()/rmdir() race

2013-12-21 Thread Michael Haggerty
When renaming a reflog file, it was possible that an empty directory that we just created using safe_create_leading_directories() might get deleted by another process before we have a chance to move the new file into it. So if the rename fails with ENOENT, then retry from the beginning. Make up