From: Wang Shilong Date: Mon, 25 Sep 2017 12:35:26 +0000 (+0800) Subject: LU-10029 osd-ldiskfs: make project inherit attr removeable X-Git-Tag: 2.10.55~49 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F29189%2F5;p=fs%2Flustre-release.git LU-10029 osd-ldiskfs: make project inherit attr removeable Inherit attribute should be clearable now Signed-off-by: Wang Shilong Change-Id: I878fde0dc134c9820436ee80979d87e6dacfb70d Reviewed-on: https://review.whamcloud.com/29189 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Li Xi Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 35fb2fc..1e4c043 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -2596,6 +2596,8 @@ static int osd_inode_setattr(const struct lu_env *env, */ if (attr->la_flags & LUSTRE_PROJINHERIT_FL) LDISKFS_I(inode)->i_flags |= LUSTRE_PROJINHERIT_FL; + else + LDISKFS_I(inode)->i_flags &= ~LUSTRE_PROJINHERIT_FL; } return 0; } diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 4a90ace..33a73d2 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -2892,6 +2892,22 @@ test_52() { } run_test 52 "Rename across different project ID" +test_53() { + ! is_project_quota_supported && + skip "Project quota is not supported" && return 0 + setup_quota_test || error "setup quota failed with $?" + local dir="$DIR/$tdir/dir" + mkdir $dir && change_project +P $dir + lsattr -pd $dir | grep P || error "inherit attribute should be set" + + change_project -Pd $dir + lsattr -pd $dir | grep P && error "inherit attribute should be cleared" + + rm -rf $dir + cleanup_quota_test +} +run_test 53 "Project inherit attribute could be cleared" + quota_fini() { do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=-quota"