mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-27 07:53:27 +00:00
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:
parent
db1b7f93b4
commit
5f3ab71103
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user