summaryrefslogtreecommitdiff
path: root/mkfs
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2018-04-11 15:29:35 +0800
committerDavid Sterba <dsterba@suse.com>2018-04-24 13:00:12 +0200
commitc57ed6ca6b1b0655bba4fff97ad10e32dba4a81d (patch)
tree5229d43bf5f8bca34d04a006e7aadbf805c364c9 /mkfs
parentcc66055f97ef7ecdd77b18487b5c32f8334b8c8b (diff)
btrfs-progs: Rename OPEN_CTREE_FS_PARTIAL to OPEN_CTREE_TEMPORARY_SUPER
The old flag OPEN_CTREE_FS_PARTIAL is in fact quite easy to be confused with OPEN_CTREE_PARTIAL, which allow btrfs-progs to open damaged filesystem (like corrupted extent/csum tree). However OPEN_CTREE_FS_PARTIAL, unlike its name, is just allowing btrfs-progs to open fs with temporary superblocks (which only has 6 basic trees on SINGLE meta/sys chunks). The usage of FS_PARTIAL is really confusing here. So rename OPEN_CTREE_FS_PARTIAL to OPEN_CTREE_TEMPORARY_SUPER, and add extra comment for its behavior. Also rename BTRFS_MAGIC_PARTIAL to BTRFS_MAGIC_TEMPORARY to keep the naming consistent. And with above comment, the usage of FS_PARTIAL in dump-tree is obviously incorrect, fix it. Fixes: 8698a2b9ba89 ("btrfs-progs: Allow inspect dump-tree to show specified tree block even some tree roots are corrupted") Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'mkfs')
-rw-r--r--mkfs/common.c2
-rw-r--r--mkfs/main.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/mkfs/common.c b/mkfs/common.c
index a6d3e668..3a80050c 100644
--- a/mkfs/common.c
+++ b/mkfs/common.c
@@ -189,7 +189,7 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg)
btrfs_set_super_bytenr(&super, cfg->blocks[MKFS_SUPER_BLOCK]);
btrfs_set_super_num_devices(&super, 1);
- btrfs_set_super_magic(&super, BTRFS_MAGIC_PARTIAL);
+ btrfs_set_super_magic(&super, BTRFS_MAGIC_TEMPORARY);
btrfs_set_super_generation(&super, 1);
btrfs_set_super_root(&super, cfg->blocks[MKFS_ROOT_TREE]);
btrfs_set_super_chunk_root(&super, cfg->blocks[MKFS_CHUNK_TREE]);
diff --git a/mkfs/main.c b/mkfs/main.c
index 0337993c..9bfddf30 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1099,7 +1099,7 @@ int main(int argc, char **argv)
}
fs_info = open_ctree_fs_info(file, 0, 0, 0,
- OPEN_CTREE_WRITES | OPEN_CTREE_FS_PARTIAL);
+ OPEN_CTREE_WRITES | OPEN_CTREE_TEMPORARY_SUPER);
if (!fs_info) {
error("open ctree failed");
goto error;