mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-11 03:31:17 +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,7 +1323,10 @@ again:
|
||||
}
|
||||
if (!looped && max_avail > 0) {
|
||||
looped = 1;
|
||||
ctl.calc_size = max_avail;
|
||||
if (ctl.type & BTRFS_BLOCK_GROUP_DUP)
|
||||
ctl.calc_size = max_avail / 2;
|
||||
else
|
||||
ctl.calc_size = max_avail;
|
||||
goto again;
|
||||
}
|
||||
return -ENOSPC;
|
||||
|
Loading…
Reference in New Issue
Block a user