Changed how we write out superblock to use append

Making the superblock look like "just another entry" allows us to treat
the superblock like "just another entry" and reuse a decent amount of
logic that would otherwise only be used a format and mount time. In this
case we can use append to write out the superblock like it was creating
a new entry on the filesystem.
This commit is contained in:
Christopher Haster
2018-03-23 16:11:36 -05:00
parent 701e4fa438
commit d0e0453651
4 changed files with 45 additions and 51 deletions

View File

@@ -73,7 +73,7 @@ lfs_mktree
lfs_chktree
echo "--- Block corruption ---"
for i in {0..33}
for i in {2..33}
do
rm -rf blocks
mkdir blocks
@@ -83,7 +83,7 @@ do
done
echo "--- Block persistance ---"
for i in {0..33}
for i in {2..33}
do
rm -rf blocks
mkdir blocks

View File

@@ -30,20 +30,10 @@ echo "--- Invalid mount ---"
tests/test.py << TEST
lfs_format(&lfs, &cfg) => 0;
TEST
rm blocks/0 blocks/1
rm -f blocks/0 blocks/1
tests/test.py << TEST
lfs_mount(&lfs, &cfg) => LFS_ERR_CORRUPT;
TEST
echo "--- Valid corrupt mount ---"
tests/test.py << TEST
lfs_format(&lfs, &cfg) => 0;
TEST
rm blocks/0
tests/test.py << TEST
lfs_mount(&lfs, &cfg) => 0;
lfs_unmount(&lfs) => 0;
TEST
echo "--- Results ---"
tests/stats.py