Re: [PATCH 3/3] btrfs: Do super block verification before writing it to disk

Anand Jain
2018-04-20T14:44:10Z

> @@ -3563,6 +3565,12 @@ int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
> sb = fs_info->super_for_commit;
> dev_item = &sb->dev_item;
>
> + if (btrfs_check_super_valid(fs_info, sb, -1)) {
> + btrfs_err(fs_info,
> + "superblock corruption detected before transaction commitment");
> + return -EUCLEAN;
> + }
> +
> mutex_lock(&fs_info->fs_devices->device_list_mutex);
> head = &fs_info->fs_devices->devices;
> max_errors = btrfs_super_num_devices(fs_info->super_copy) - 1;

With patch 1/3 (incompat feature checks) now this set as a
whole address my concern that I explained earlier. I am ok with
this approach.

Thanks, Anand