From: Mikhail Pershin Date: Mon, 22 Jul 2024 08:50:06 +0000 (+0300) Subject: LU-18057 mdt: don't include DOM bit to stripes lock X-Git-Tag: 2.15.65~8 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c1fec4e4e8360a946b85459d9c2db9d7be18778f;p=fs%2Flustre-release.git LU-18057 mdt: don't include DOM bit to stripes lock Exclude DOM bit from inodebits mask used to restriping. That might cause assertions further in inodebits code if conflicts with GROUP lock. This bit is not needed anyway but is taken just as part of MDS_INODELOCK_FULL used there Patch uses mask MDS_RESTRIPE_ELC with excluded DOM bit for restriping and prohibits further attempts to combine DOM lock with other ibits mandatory. Note, that is restriction only for local MDT locks as they are blocking locks. In all such cases trybits to be used either for DoM bit or for others Signed-off-by: Mikhail Pershin Change-Id: I2fed05caf60aaa17a0d91ecf7b72df2b4ff95141 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55828 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 7767191..91d1328 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3960,6 +3960,12 @@ int mdt_object_lock_internal(struct mdt_thread_info *info, struct lustre_handle *handle; int rc; + /* DoM lock shouln't be combined with other ibits when it is + * taken locally due to potential conflict with GROUP lock. + * Consider trylock either for DoM bit or for others + */ + LASSERT(!(*ibits & MDS_INODELOCK_DOM && *ibits & ~MDS_INODELOCK_DOM)); + policy->l_inodebits.bits = *ibits; policy->l_inodebits.try_bits = trybits; policy->l_inodebits.li_gid = lh->mlh_gid; diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index e123f00..aadde459 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -436,7 +436,7 @@ static int mdt_restripe(struct mdt_thread_info *info, /* lock object */ lhc = &info->mti_lh[MDT_LH_CHILD]; rc = mdt_object_stripes_lock(info, parent, child, lhc, einfo, - MDS_INODELOCK_FULL, LCK_PW); + MDS_INODELOCK_ELC, LCK_PW); if (rc) GOTO(unlock_child, rc); diff --git a/lustre/mdt/mdt_restripe.c b/lustre/mdt/mdt_restripe.c index e09645e..656b5cf 100644 --- a/lustre/mdt/mdt_restripe.c +++ b/lustre/mdt/mdt_restripe.c @@ -395,7 +395,7 @@ static int mdt_auto_split(struct mdt_thread_info *info) lhc = &info->mti_lh[MDT_LH_CHILD]; rc = mdt_object_stripes_lock(info, parent, child, lhc, einfo, - MDS_INODELOCK_FULL, LCK_EX); + MDS_INODELOCK_ELC, LCK_EX); if (rc) GOTO(unlock_parent, rc); diff --git a/lustre/mdt/mdt_xattr.c b/lustre/mdt/mdt_xattr.c index 42424f8..f2f1c47 100644 --- a/lustre/mdt/mdt_xattr.c +++ b/lustre/mdt/mdt_xattr.c @@ -384,7 +384,7 @@ int mdt_dir_layout_update(struct mdt_thread_info *info) /* lock object */ lhc = &info->mti_lh[MDT_LH_CHILD]; rc = mdt_object_stripes_lock(info, pobj, obj, lhc, einfo, - MDS_INODELOCK_FULL, LCK_EX); + MDS_INODELOCK_ELC, LCK_EX); if (rc) GOTO(unlock_pobj, rc);