Whamcloud - gitweb
LU-15721 llite: only statfs for projid if PROJINHERIT set 52/47352/3
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 14 May 2022 14:10:20 +0000 (08:10 -0600)
committerOleg Drokin <green@whamcloud.com>
Sat, 15 Oct 2022 05:58:10 +0000 (05:58 +0000)
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.

Fixes: e5c8f6670f ("LU-9555 quota: df should return projid-specific values")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I27cb444c3dfabc0ec693cee6fe6f9cae6db8a77a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/47352
Reviewed-by: Wang Shilong <wangshilong1991@gmail.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
lustre/llite/llite_lib.c

index d688d1b..0338b86 100644 (file)
@@ -2610,7 +2610,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,