Re: The *right* algorithm for determining the amount of free space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 18, 2016 at 06:58:02PM +0100, David Sterba wrote:
> On Fri, Mar 11, 2016 at 10:17:03PM +0000, Hugo Mills wrote:
> >    I know I promised this a while ago and didn't get round to it, but
> > Henk's tinkering reminded me of it. I note specifically that the
> > algorithm used to give the free space to plain old df gives incorrect
> > results -- probably because it's not using the algorithm below.
> 
> So the algorithm is supposed to implement btrfs_calc_avail_data_space,
> the raid5/6 parts are missing from there, otherwise the structure of the
> function follows the proposed algorithm.

   Well, the current code gets the free space estimation wrong even
with RAID-1. It's not usually *very* wrong, but it's still not right,
somewhere.

> >    There is an algorithm that (seems to) give the correct number of
> > block groups which can be allocated, given a current allocation state
> > of the FS. I haven't been able to prove it correct, but it seems to
> > work. Here's some pseudocode for it:
> 
> It does sound correct to me. Thanks for writing it up.

   Hugo.

-- 
Hugo Mills             | Great films about cricket: The Umpire Strikes Back
hugo@... carfax.org.uk |
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux