Re: [PATCH] f2fs: report sub-block project quotas in statfs

From: Chao Yu

Date: Sun Nov 01 2026 - 21:25:09 EST


On 11/2/26 07:05, Hungyu Lin wrote:
f2fs_statfs_project() converts the selected block quota from bytes to
filesystem blocks before checking whether a limit is set. A nonzero
limit smaller than one filesystem block therefore becomes zero and
skips the project block statistics.

For example, on a filesystem with 4 KiB blocks, setquota accepts a
1 KiB project hard limit, but df on the project-inherit directory
reports the filesystem-wide capacity and free space instead of zero
whole blocks. Quota enforcement still rejects a write that requires
another data block.

Check the byte limit before converting it to blocks. This distinguishes
a sub-block limit from an unlimited quota while retaining the existing
rounding and free-space calculations.


Cc: stable@xxxxxxxxxxxxxxx

Fixes: ddc34e328d06 ("f2fs: introduce f2fs_statfs_project")
Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,