Fixed mkdir when inserting into a non-end block

This was an oversight on my part when adding strict ordering to
directories. Unfortunately now we can't take advantage of the atomic
creation of tail+dir entries. Now we need to first create the tail, then
create the actually directory entry. If we lose power, the orphan is
cleaned up like orphans created during remove.

Note that we still take advantage of the atomic tail+dir entries if we
are an end block. This is actually because this corner case is
complicated to _not_ do atomically, needing to update the directory we
just committed to.
This commit is contained in:
Christopher Haster
2018-10-05 18:22:33 -05:00
parent 97a7191814
commit 795dd8c7ab
3 changed files with 39 additions and 10 deletions

View File

@@ -89,7 +89,7 @@ do
rm -rf blocks
mkdir blocks
lfs_mktree
chmod a-w blocks/$b
chmod a-w blocks/$b || true
lfs_mktree
lfs_chktree
done