diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2013-10-25 17:30:45 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-31 08:21:59 -0800 |
commit | b4f4473e8a88896c8ff12578183af0f099d33591 (patch) | |
tree | 1a39d6ec8c2f9042d898dbec8b135d2178a9a108 /cmds-check.c | |
parent | 1f5e3b2825a3a3763334aeffecaf442ad18750c2 (diff) |
Btrfs-progs: don't output baffling message when checking a fresh fs
As we know, a new fs doesn't have space cache, so we set the cache generation
of the super block to be -1ULL, it is not equal to the fs generation. But the
check program didn't consider this case, and output the following message
cache and super generation don't match, space cache will be invalidated
directly, it would be baffling the users. So we should avoid outputing such
message. This patch fixes this problem.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r-- | cmds-check.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c index cdcc4ba4..310126ae 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -3367,7 +3367,8 @@ static int check_space_cache(struct btrfs_root *root) int ret; int error = 0; - if (btrfs_super_generation(root->fs_info->super_copy) != + if (btrfs_super_cache_generation(root->fs_info->super_copy) != -1ULL && + btrfs_super_generation(root->fs_info->super_copy) != btrfs_super_cache_generation(root->fs_info->super_copy)) { printf("cache and super generation don't match, space cache " "will be invalidated\n"); |