From 9085d94a9061ce6553a4c4d8c32513084e48cd2f Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 14 May 2022 08:10:20 -0600 Subject: [PATCH] LU-15721 llite: only statfs for projid if PROJINHERIT set If projid is set on a directory but PROJINHERIT is not, do not report the project quota for statfs. This matches how ext4_statfs() and xfs_fs_statfs() behave, on which Lustre project quota is modelled. Lustre-change: https://review.whamcloud.com/47352 Lustre-commit: 4192f28733fe62173dec4a522c6589ee741df474 Fixes: e5c8f6670f ("LU-9555 quota: df should return projid-specific values") Signed-off-by: Andreas Dilger Change-Id: I27cb444c3dfabc0ec693cee6fe6f9cae6db8a77a Reviewed-on: https://review.whamcloud.com/47586 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Li Dongyang --- lustre/llite/llite_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index a27fb48..ff81613 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -2445,7 +2445,8 @@ int ll_statfs(struct dentry *de, struct kstatfs *sfs) sfs->f_bavail = osfs.os_bavail; sfs->f_fsid.val[0] = (__u32)fsid; sfs->f_fsid.val[1] = (__u32)(fsid >> 32); - if (ll_i2info(de->d_inode)->lli_projid) + if (ll_i2info(de->d_inode)->lli_projid && + test_bit(LLIF_PROJECT_INHERIT, &ll_i2info(de->d_inode)->lli_flags)) return ll_statfs_project(de->d_inode, sfs); ll_stats_ops_tally(ll_s2sbi(sb), LPROC_LL_STATFS, -- 1.8.3.1