diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 15c35b62ff14..c6b24e7c308a 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1226,6 +1226,7 @@ xfs_fs_statfs( | |||
1226 | struct xfs_inode *ip = XFS_I(dentry->d_inode); | 1226 | struct xfs_inode *ip = XFS_I(dentry->d_inode); |
1227 | __uint64_t fakeinos, id; | 1227 | __uint64_t fakeinos, id; |
1228 | xfs_extlen_t lsize; | 1228 | xfs_extlen_t lsize; |
1229 | __int64_t ffree; | ||
1229 | 1230 | ||
1230 | statp->f_type = XFS_SB_MAGIC; | 1231 | statp->f_type = XFS_SB_MAGIC; |
1231 | statp->f_namelen = MAXNAMELEN - 1; | 1232 | statp->f_namelen = MAXNAMELEN - 1; |
@@ -1249,7 +1250,11 @@ xfs_fs_statfs( | |||
1249 | statp->f_files = min_t(typeof(statp->f_files), | 1250 | statp->f_files = min_t(typeof(statp->f_files), |
1250 | statp->f_files, | 1251 | statp->f_files, |
1251 | mp->m_maxicount); | 1252 | mp->m_maxicount); |
1252 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); | 1253 | |
1254 | /* make sure statp->f_ffree does not underflow */ | ||
1255 | ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); | ||
1256 | statp->f_ffree = max_t(__int64_t, ffree, 0); | ||
1257 | |||
1253 | spin_unlock(&mp->m_sb_lock); | 1258 | spin_unlock(&mp->m_sb_lock); |
1254 | 1259 | ||
1255 | if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) || | 1260 | if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) || |