From 299062a45622ff53516a17e8a70a6d1c52e58256 Mon Sep 17 00:00:00 2001 From: Andy Grover Date: Wed, 13 Jan 2021 16:32:20 -0800 Subject: [PATCH] Fix mkfs check for existing ScoutFS superblock We were checking for the wrong magic value. We now need to use -f when running mkfs in run-tests for things to work. Signed-off-by: Andy Grover --- tests/run-tests.sh | 2 +- utils/src/blkid.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 6cbfd1b9..4963ff9a 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -304,7 +304,7 @@ if [ -n "$T_UNMOUNT" ]; then fi if [ -n "$T_MKFS" ]; then - cmd scoutfs mkfs -Q "$T_QUORUM" "$T_META_DEVICE" "$T_DATA_DEVICE" + cmd scoutfs mkfs -Q "$T_QUORUM" "$T_META_DEVICE" "$T_DATA_DEVICE" -f fi if [ -n "$T_INSMOD" ]; then diff --git a/utils/src/blkid.c b/utils/src/blkid.c index 7dd19574..71584fc1 100644 --- a/utils/src/blkid.c +++ b/utils/src/blkid.c @@ -71,7 +71,7 @@ static int check_bdev_scoutfs(int fd, char *devname, char *usage) if (ret) return ret; - if (le32_to_cpu(super->hdr.magic) == SCOUTFS_SUPER_MAGIC) { + if (le32_to_cpu(super->hdr.magic) == SCOUTFS_BLOCK_MAGIC_SUPER) { fprintf(stderr, "%s: appears to contain an existing " "ScoutFS superblock\n", devname); ret = -EINVAL;