Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 2fe33661 authored by Stuart Brodsky's avatar Stuart Brodsky Committed by Dave Chinner
Browse files

xfs: ensure f_ffree returned by statfs() is non-negative



Because of delayed updates to sb_icount field in the super block, it
is possible to allocate over maxicount number of inodes.  This
causes the arithmetic to calculate a negative number of free inodes
in user commands like df or stat -f.

Since maxicount is a somewhat arbitrary number, a slight over
allocation is not critical but user commands should be displayed as
0 or greater and never go negative.  To do this the value in the
stats buffer f_ffree is capped to never go negative.

[ Modified to use max_t as per Christoph's comment. ]

Signed-off-by: default avatarStu Brodsky <sbrodsky@sgi.com>
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
parent efceab1d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment