Whamcloud - gitweb
LU-5152 quota: disable sync chgrp to OSTs 05/33705/2
authorHongchao Zhang <hongchao@whamcloud.com>
Wed, 14 Nov 2018 23:10:46 +0000 (18:10 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Nov 2018 22:55:51 +0000 (22:55 +0000)
The syschronous chgrp to OSTs introduced by the previous patch
(the commit is 8a71fd5061bd073e055e6cbba1d238305e6827bb) causes
deadlock between MDT and OST, this patch disable it for now and
leave the updated patch to fix it.

Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Change-Id: I5ce48424f4d2011ce62e69047ace7f0b7c3ebbe5
Reviewed-on: https://review.whamcloud.com/33705
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdd/mdd_object.c
lustre/tests/sanity-quota.sh

index 4b81988..4bc830c 100644 (file)
@@ -1163,6 +1163,7 @@ int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
        struct lu_attr *attr = MDD_ENV_VAR(env, cattr);
        const struct lu_attr *la = &ma->ma_attr;
        struct lu_ucred  *uc;
+       bool chrgrp_by_unprivileged_user = false;
        int rc;
        ENTRY;
 
@@ -1194,15 +1195,23 @@ int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
        uc = lu_ucred_check(env);
        if (S_ISREG(attr->la_mode) && la->la_valid & LA_GID &&
            la->la_gid != attr->la_gid && uc != NULL && uc->uc_fsuid != 0) {
+               /* LU-10048: disable synchronous chgrp operation for it will
+                * cause deadlock between MDT and OST.
                la_copy->la_valid |= LA_FLAGS;
                la_copy->la_flags |= LUSTRE_SET_SYNC_FL;
+                */
+               chrgrp_by_unprivileged_user = true;
 
-               /* Flush the possible existing sync requests to OSTs to
-                * keep the order of sync for the current setattr operation
+               /* Flush the possible existing client setattr requests to OSTs
+                * to keep the order with the current setattr operation that
                 * will be sent directly to OSTs. see LU-5152 */
+               /* LU-11303 disable sync as this is too heavyweight.
+                * This should be replaced with a sync only for the object
+                * being modified here, not the whole filesystem.
                rc = dt_sync(env, mdd->mdd_child);
                if (rc)
                        GOTO(out, rc);
+                */
        }
 
        handle = mdd_trans_create(env, mdd);
@@ -1221,7 +1230,8 @@ int mdd_attr_set(const struct lu_env *env, struct md_object *obj,
        if (rc)
                GOTO(out, rc);
 
-       if (mdd->mdd_sync_permission && permission_needs_sync(attr, la))
+       if (!chrgrp_by_unprivileged_user && mdd->mdd_sync_permission &&
+           permission_needs_sync(attr, la))
                handle->th_sync = 1;
 
        if (la->la_valid & (LA_MTIME | LA_CTIME))
index 7abbad6..86c54fe 100755 (executable)
@@ -10,8 +10,8 @@ SRCDIR=$(dirname $0)
 export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
 
 ONLY=${ONLY:-"$*"}
-# Bug number for skipped test:
-ALWAYS_EXCEPT="$SANITY_QUOTA_EXCEPT"
+# Bug number for skipped test:      LU-5152
+ALWAYS_EXCEPT="$SANITY_QUOTA_EXCEPT 55"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 [ "$ALWAYS_EXCEPT$EXCEPT" ] &&