diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index ed6d4c83c1e7..feb67dfd663d 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2799,10 +2799,10 @@ int open_ctree(struct super_block *sb, | |||
2799 | * the whole block of INFO_SIZE | 2799 | * the whole block of INFO_SIZE |
2800 | */ | 2800 | */ |
2801 | memcpy(fs_info->super_copy, bh->b_data, sizeof(*fs_info->super_copy)); | 2801 | memcpy(fs_info->super_copy, bh->b_data, sizeof(*fs_info->super_copy)); |
2802 | memcpy(fs_info->super_for_commit, fs_info->super_copy, | ||
2803 | sizeof(*fs_info->super_for_commit)); | ||
2804 | brelse(bh); | 2802 | brelse(bh); |
2805 | 2803 | ||
2804 | disk_super = fs_info->super_copy; | ||
2805 | |||
2806 | ASSERT(!memcmp(fs_info->fs_devices->fsid, fs_info->super_copy->fsid, | 2806 | ASSERT(!memcmp(fs_info->fs_devices->fsid, fs_info->super_copy->fsid, |
2807 | BTRFS_FSID_SIZE)); | 2807 | BTRFS_FSID_SIZE)); |
2808 | 2808 | ||
@@ -2812,6 +2812,16 @@ int open_ctree(struct super_block *sb, | |||
2812 | BTRFS_FSID_SIZE)); | 2812 | BTRFS_FSID_SIZE)); |
2813 | } | 2813 | } |
2814 | 2814 | ||
2815 | features = btrfs_super_flags(disk_super); | ||
2816 | if (features & BTRFS_SUPER_FLAG_CHANGING_FSID_V2) { | ||
2817 | features &= ~BTRFS_SUPER_FLAG_CHANGING_FSID_V2; | ||
2818 | btrfs_set_super_flags(disk_super, features); | ||
2819 | btrfs_info(fs_info, | ||
2820 | "found metadata UUID change in progress flag, clearing"); | ||
2821 | } | ||
2822 | |||
2823 | memcpy(fs_info->super_for_commit, fs_info->super_copy, | ||
2824 | sizeof(*fs_info->super_for_commit)); | ||
2815 | 2825 | ||
2816 | ret = btrfs_validate_mount_super(fs_info); | 2826 | ret = btrfs_validate_mount_super(fs_info); |
2817 | if (ret) { | 2827 | if (ret) { |
@@ -2820,7 +2830,6 @@ int open_ctree(struct super_block *sb, | |||
2820 | goto fail_alloc; | 2830 | goto fail_alloc; |
2821 | } | 2831 | } |
2822 | 2832 | ||
2823 | disk_super = fs_info->super_copy; | ||
2824 | if (!btrfs_super_root(disk_super)) | 2833 | if (!btrfs_super_root(disk_super)) |
2825 | goto fail_alloc; | 2834 | goto fail_alloc; |
2826 | 2835 | ||