Skip to content

Commit 1168076

Browse files
MiaoheLinakpm00
authored andcommitted
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>
1 parent 445c809 commit 1168076

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/hugetlbfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf)
10901090
buf->f_bsize = huge_page_size(h);
10911091
if (sbinfo) {
10921092
spin_lock(&sbinfo->stat_lock);
1093-
/* If no limits set, just report 0 for max/free/used
1093+
/* If no limits set, just report 0 or -1 for max/free/used
10941094
* blocks, like simple_statfs() */
10951095
if (sbinfo->spool) {
10961096
long free_pages;

0 commit comments

Comments
 (0)