diff options
| -rw-r--r-- | fs/xfs/xfs_super.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index a3b791b85336..26afa436fafe 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
| @@ -1111,6 +1111,11 @@ xfs_fs_statfs( | |||
| 1111 | statp->f_files, | 1111 | statp->f_files, |
| 1112 | mp->m_maxicount); | 1112 | mp->m_maxicount); |
| 1113 | 1113 | ||
| 1114 | /* If sb_icount overshot maxicount, report actual allocation */ | ||
| 1115 | statp->f_files = max_t(typeof(statp->f_files), | ||
| 1116 | statp->f_files, | ||
| 1117 | sbp->sb_icount); | ||
| 1118 | |||
| 1114 | /* make sure statp->f_ffree does not underflow */ | 1119 | /* make sure statp->f_ffree does not underflow */ |
| 1115 | ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); | 1120 | ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); |
| 1116 | statp->f_ffree = max_t(__int64_t, ffree, 0); | 1121 | statp->f_ffree = max_t(__int64_t, ffree, 0); |
