From: Hongchao Zhang Date: Wed, 14 Nov 2018 23:10:46 +0000 (-0500) Subject: LU-5152 quota: disable sync chgrp to OSTs X-Git-Tag: 2.12.0-RC1~10 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7b46ff54afb23c04dec74ef162ed9052f7259e4a;ds=sidebyside LU-5152 quota: disable sync chgrp to OSTs 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 Change-Id: I5ce48424f4d2011ce62e69047ace7f0b7c3ebbe5 Reviewed-on: https://review.whamcloud.com/33705 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Wang Shilong Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index 4b81988..4bc830c 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -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)) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 7abbad6..86c54fe 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -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" ] &&