From: Stuart Brodsky Date: Tue, 24 Aug 2010 01:46:05 +0000 (+1000) Subject: xfs: ensure f_ffree returned by statfs() is non-negative X-Git-Tag: v2.6.36-rc3~27^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fe33661fcd79d4c53022509f7223d526b5fa233;p=pandora-kernel.git 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 Signed-off-by: Dave Chinner --- Reading git-diff-tree failed