Re: [PATCH v5 18/35] commit_lock_file(): if close fails, roll back

2014-09-23 Thread Michael Haggerty
On 09/17/2014 12:19 AM, Jonathan Nieder wrote: Michael Haggerty wrote: If closing an open lockfile fails, then we cannot be sure of the contents of the lockfile Is that true? It seems more like a bug in close_lock_file: if it fails, perhaps it should either set lk-fd back to fd or unlink

[PATCH v5 18/35] commit_lock_file(): if close fails, roll back

2014-09-16 Thread Michael Haggerty
If closing an open lockfile fails, then we cannot be sure of the contents of the lockfile, so there is nothing sensible to do but delete it. This change also leaves the lock_file object in a defined state in this error path (namely, unlocked). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu

Re: [PATCH v5 18/35] commit_lock_file(): if close fails, roll back

2014-09-16 Thread Jonathan Nieder
Michael Haggerty wrote: If closing an open lockfile fails, then we cannot be sure of the contents of the lockfile Is that true? It seems more like a bug in close_lock_file: if it fails, perhaps it should either set lk-fd back to fd or unlink the lockfile itself. What do other callers do on