Re: [PATCH v2] hugetlbfs: report inode limits without a memory subpool
From: Oscar Salvador (SUSE)
Date: Mon Nov 16 2026 - 03:57:02 EST
On Wed, Nov 11, 2026 at 01:01:45PM +0000, Hungyu Lin wrote:
> A hugetlbfs mount can limit inodes with nr_inodes independently of size
> or min_size. hugetlbfs_statfs() only fills f_files and f_ffree when a
> memory subpool exists, so an inode-only limit is enforced but its inode
> counts are reported as zero.
>
> For example, a fresh mount with nr_inodes=4 reports zero total and free
> inodes instead of 4 and 3. This hides the inode limit from tools such
> as df -i, even when creating another file fails with ENOSPC.
>
> Report the inode counters when an inode limit is configured,
> independently of the memory subpool. Preserve the existing zero and -1
> results for unlimited inode counts.
>
> Fixes: 74a8a65c5261 ("[PATCH] Fix hugetlbfs_statfs() reporting of block limits")
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
> Reviewed-by: Aveline Noir <jm5905938@xxxxxxxxx>
> Tested-by: Aveline Noir <jm5905938@xxxxxxxxx>
Acked-by: Oscar Salvador (SUSE) <osalvador@xxxxxxxxxx>
--
Oscar Salvador
SUSE Labs