|
@@ -2832,7 +2832,11 @@ static noinline_for_stack int scrub_supers(struct scrub_ctx *sctx,
|
|
|
if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state))
|
|
|
return -EIO;
|
|
|
|
|
|
- gen = root->fs_info->last_trans_committed;
|
|
|
+ /* Seed devices of a new filesystem has their own generation. */
|
|
|
+ if (scrub_dev->fs_devices != root->fs_info->fs_devices)
|
|
|
+ gen = scrub_dev->generation;
|
|
|
+ else
|
|
|
+ gen = root->fs_info->last_trans_committed;
|
|
|
|
|
|
for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
|
|
|
bytenr = btrfs_sb_offset(i);
|