Btrfs-progs: fix an off-by-one in write_dev_supers()

Fix an off-by-one in write_dev_supers().

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
This commit is contained in:
Stefan Behrens 2012-10-31 17:56:56 +01:00 committed by David Sterba
parent db1b7f93b4
commit 5f3ab71103

View File

@ -998,7 +998,7 @@ int write_dev_supers(struct btrfs_root *root, struct btrfs_super_block *sb,
for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) { for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
bytenr = btrfs_sb_offset(i); bytenr = btrfs_sb_offset(i);
if (bytenr + BTRFS_SUPER_INFO_SIZE >= device->total_bytes) if (bytenr + BTRFS_SUPER_INFO_SIZE > device->total_bytes)
break; break;
btrfs_set_super_bytenr(sb, bytenr); btrfs_set_super_bytenr(sb, bytenr);