diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2022-07-26 17:29:18 +0300 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-07-30 04:07:19 +0300 |
commit | 116807634569bdb9defe1c01e442e76e4f432961 (patch) | |
tree | fe413772b0f1ece665ba0619b410d0a533105ff9 /fs/hugetlbfs | |
parent | 445c809829dc164c5b1917c72e335bd294aa4dc8 (diff) | |
download | linux-116807634569bdb9defe1c01e442e76e4f432961.tar.xz |
hugetlbfs: fix inaccurate comment in hugetlbfs_statfs()
In some cases, e.g. when size option is not specified, f_blocks, f_bavail
and f_bfree will be set to -1 instead of 0. Likewise, when nr_inodes
isn't specified, f_files and f_ffree will be set to -1 too. Update the
comment to make this clear.
Link: https://lkml.kernel.org/r/20220726142918.51693-6-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/hugetlbfs')
-rw-r--r-- | fs/hugetlbfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 998672be99c5..be22cffbb579 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1090,7 +1090,7 @@ static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bsize = huge_page_size(h); if (sbinfo) { spin_lock(&sbinfo->stat_lock); - /* If no limits set, just report 0 for max/free/used + /* If no limits set, just report 0 or -1 for max/free/used * blocks, like simple_statfs() */ if (sbinfo->spool) { long free_pages; |