Whamcloud - gitweb
LU-10029 osd-ldiskfs: make project inherit attr removeable 89/29189/5
authorWang Shilong <wshilong@ddn.com>
Mon, 25 Sep 2017 12:35:26 +0000 (20:35 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 19 Oct 2017 06:18:12 +0000 (06:18 +0000)
Inherit attribute should be clearable now

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I878fde0dc134c9820436ee80979d87e6dacfb70d
Reviewed-on: https://review.whamcloud.com/29189
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/tests/sanity-quota.sh

index 35fb2fc..1e4c043 100644 (file)
@@ -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;
 }
index 4a90ace..33a73d2 100755 (executable)
@@ -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"