If we are cycling through all of the mirrors trying to find the best one we need
to make sure we set best_mirror to an actual mirror number and not 0. Otherwise
we could end up reading a mirror that wasn't the best and make everybody sad.
Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
ignore = 1;
continue;
}
- if (btrfs_header_generation(eb) > best_transid) {
+ if (btrfs_header_generation(eb) > best_transid && mirror_num) {
best_transid = btrfs_header_generation(eb);
good_mirror = mirror_num;
}