From 3c350dec06da272fed7ef1ea0eb5031131c77671 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 19 Aug 2016 16:40:14 +0200 Subject: btrfs-progs: introduce signature for a partially set up filesystem Currently the superblock is created first, with a valid signaure, but the rest of the filesystem is missing. When the creation process is interrupted, the filesystem still might be considered as valid. To prevent that, create the filesytem with an invalid signature that would be still recognized during the mkfs process, and finalize at the end. Signed-off-by: David Sterba --- ctree.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ctree.h') diff --git a/ctree.h b/ctree.h index b9fb732c..89e47abd 100644 --- a/ctree.h +++ b/ctree.h @@ -40,6 +40,12 @@ struct btrfs_trans_handle; struct btrfs_free_space_ctl; #define BTRFS_MAGIC 0x4D5F53665248425FULL /* ascii _BHRfS_M, no null */ +/* + * Fake signature for an unfinalized filesystem, structures might be partially + * created or missing. + */ +#define BTRFS_MAGIC_PARTIAL 0x4D5F536652484221ULL /* ascii !BHRfS_M, no null */ + #define BTRFS_MAX_MIRRORS 3 #define BTRFS_MAX_LEVEL 8 -- cgit v1.2.3