6261bafed2
Fortunately these operations are heavily tested in test_dirs. The only difference with files is the possibility for shrubs to need to be copied. Bugs fixed: - It's counterintuitive, but lfsr_rbyd_appendcompactattr _can_ error with LFS_ERR_RANGE when we are copying a shrub. This can happen if the underlying mdir needs compaction itself. - It's possible to null-trunk bshrubs to appear in our filesystem traversal. Null-trunk bshrubs don't usually appear in any stable state, but they are created by lfsr_bshrub_alloc and lfsr_btree_commit to represent new, yet-uncommitted shrubs. This gets a bit tricky because we also use null-trunks to indicate if lfsr_btree_traversal has traversed the root. We can't rely on bid >= weight for this because zero-weight btrees are allowed. The solution here, though maybe temporary (famous last words), is to treat null-trunk btrees as not having a root. Which isn't really true, but null-trunk btree roots only exist between allocator checkpoints, so they are allowed to be unreachable. We really need more asserts that this is the case though... At least added an assert that we never commit/read null trunks on disk.