From 791891ae3b6849416829274105e6e702651d3781 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Mon, 13 Aug 2018 14:20:40 -0500 Subject: [PATCH] WIP Changed unwritable superblock to ENOSPC to match similar situations --- lfs.c | 2 +- tests/test_format.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lfs.c b/lfs.c index eda0912..eef1484 100644 --- a/lfs.c +++ b/lfs.c @@ -1237,7 +1237,7 @@ relocate: // can't relocate superblock, filesystem is now frozen if (lfs_pair_cmp(oldpair, (const lfs_block_t[2]){0, 1}) == 0) { LFS_WARN("Superblock %"PRIu32" has become unwritable", oldpair[1]); - return LFS_ERR_CORRUPT; + return LFS_ERR_NOSPC; } // relocate half of pair diff --git a/tests/test_format.sh b/tests/test_format.sh index 06438bc..d885f83 100755 --- a/tests/test_format.sh +++ b/tests/test_format.sh @@ -22,7 +22,7 @@ echo "--- Invalid superblocks ---" ln -f -s /dev/zero blocks/0 ln -f -s /dev/zero blocks/1 tests/test.py << TEST - lfs_format(&lfs, &cfg) => LFS_ERR_CORRUPT; + lfs_format(&lfs, &cfg) => LFS_ERR_NOSPC; TEST rm blocks/0 blocks/1