When creating a lock the FSFS code writes the lock file before adding the lock
to the digest files of the parents. This is the wrong order, it should add the
lock to the digest files before creating the lock file. A problem occurs if the
server is interrupted part way through the lock operation and so doesn't add the
digest entries for a lock.
If the lock file for /A/B/f exists without the digest entries the answer to the
questions:
- Is file /A/B/f locked?
- Is there a lock under /A?
will be different and so the repository is inconsistent, e.g. an attempt to
delete /A/B/f will fail while deleting /A will succeed.
If the digest file entries exist without the lock file the answer to the
questions is "no lock" in both cases and the repository is consistent.