mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-24 20:17:57 +00:00
btrfs-progs: fix to use half the available space for DUP profile
In the DUP profile, we can use only half of the space available in a device extent. Fix the calculation of calc_size for it. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
13a6cff8b6
commit
907c5fd7a4
@ -1323,6 +1323,9 @@ again:
|
|||||||
}
|
}
|
||||||
if (!looped && max_avail > 0) {
|
if (!looped && max_avail > 0) {
|
||||||
looped = 1;
|
looped = 1;
|
||||||
|
if (ctl.type & BTRFS_BLOCK_GROUP_DUP)
|
||||||
|
ctl.calc_size = max_avail / 2;
|
||||||
|
else
|
||||||
ctl.calc_size = max_avail;
|
ctl.calc_size = max_avail;
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user