summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_fsops.h
diff options
context:
space:
mode:
authorStuart Brodsky <sbrodsky@sgi.com>2010-08-24 05:46:05 +0400
committerDave Chinner <david@fromorbit.com>2010-08-24 05:46:05 +0400
commit2fe33661fcd79d4c53022509f7223d526b5fa233 (patch)
tree1c26f0ca23372dc7142fa4f9395056c529378801 /fs/xfs/xfs_fsops.h
parentefceab1d563153a2b1a6e7d35376241a48126989 (diff)
downloadlinux-2fe33661fcd79d4c53022509f7223d526b5fa233.tar.xz
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: Stu Brodsky <sbrodsky@sgi.com> Signed-off-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_fsops.h')
0 files changed, 0 insertions, 0 deletions