summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/bcachefs/bcachefs_format.h5
-rw-r--r--fs/bcachefs/super-io.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
index 0aa522b7f0f2..f29e3e7e9525 100644
--- a/fs/bcachefs/bcachefs_format.h
+++ b/fs/bcachefs/bcachefs_format.h
@@ -1578,7 +1578,7 @@ struct bch_sb_layout {
* @version_min - Oldest metadata version this filesystem contains; so we can
* safely drop compatibility code and refuse to mount filesystems
* we'd need it for
- * @magic - identifies as a bcachefs superblock (BCACHE_MAGIC)
+ * @magic - identifies as a bcachefs superblock (BCHFS_MAGIC)
* @seq - incremented each time superblock is written
* @uuid - used for generating various magic numbers and identifying
* member devices, never changes
@@ -1894,6 +1894,9 @@ enum bch_compression_opts {
#define BCACHE_MAGIC \
UUID_LE(0xf67385c6, 0x1a4e, 0xca45, \
0x82, 0x65, 0xf5, 0x7f, 0x48, 0xba, 0x6d, 0x81)
+#define BCHFS_MAGIC \
+ UUID_LE(0xf67385c6, 0xce66, 0xa990, \
+ 0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef)
#define BCACHEFS_STATFS_MAGIC 0xca451a4e
diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c
index 6d99a5814392..0aa243f5fae6 100644
--- a/fs/bcachefs/super-io.c
+++ b/fs/bcachefs/super-io.c
@@ -211,7 +211,8 @@ static int validate_sb_layout(struct bch_sb_layout *layout, struct printbuf *out
u64 offset, prev_offset, max_sectors;
unsigned i;
- if (uuid_le_cmp(layout->magic, BCACHE_MAGIC)) {
+ if (uuid_le_cmp(layout->magic, BCACHE_MAGIC) &&
+ uuid_le_cmp(layout->magic, BCHFS_MAGIC)) {
prt_printf(out, "Not a bcachefs superblock layout");
return -BCH_ERR_invalid_sb_layout;
}
@@ -538,7 +539,8 @@ reread:
return ret;
}
- if (uuid_le_cmp(sb->sb->magic, BCACHE_MAGIC)) {
+ if (uuid_le_cmp(sb->sb->magic, BCACHE_MAGIC) &&
+ uuid_le_cmp(sb->sb->magic, BCHFS_MAGIC)) {
prt_printf(err, "Not a bcachefs superblock");
return -BCH_ERR_invalid_sb_magic;
}