Re: [PATCH V4] xfs: be honest about used inodes in statfs

Dave Chinner
2014-02-25T00:52:40Z

On Mon, Feb 24, 2014 at 06:27:35PM -0600, Eric Sandeen wrote:
> Because we have lazy counters, it's possible that we over-allocate
> inodes past the maxicount (imaxpct) limit.
>
> A previous commit,
>
> 2fe3366 xfs: ensure f_ffree returned by statfs() is non-negative
>
> stopped statfs from underflowing f_ffree in this case, but that
> only happened when we mis-reported f_files, capped at maxicount.
>
> Change statfs to report the actual number of inodes allocated,
> even if it is greater than maxicount. It's reality.
> Deal with it.
>
> Also rework code & rename vars for clarity after input from
> dchinner & bfoster.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> V2: code cleanup thanks to Brian
> V3: more cleanup thanks to Dave
> V4: Oh for crying out loud... (add maxicount test in else)

Looks good now!

Reviewed-by: Dave Chinner <dchinner@redhat.com>

--
Dave Chinner
david@fromorbit.com