Commit 350a99d
gvfs-helper: fix race condition when creating loose object dirs
When two gvfs-helper processes are the first to create a loose object
directory, the processes (A and B in the timeline below) could have
the following race:
1. A sees that the directory does not exist.
2. B sees that the directory does not exist.
3. A creates the directory with success.
4. B fails to create the directory and fails.
Instead of having B fail here, just check for the directory's
existence before reporting an error. That solves the race and
allows tests to pass.
Signed-off-by: Derrick Stolee <[email protected]>1 parent 287ac47 commit 350a99d
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1049 | 1049 | | |
1050 | 1050 | | |
1051 | 1051 | | |
1052 | | - | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1053 | 1055 | | |
1054 | 1056 | | |
1055 | 1057 | | |
| |||
0 commit comments