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 <mpershin@whamcloud.com>
Change-Id: I2fed05caf60aaa17a0d91ecf7b72df2b4ff95141
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55828
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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;
/* 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);
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);
/* 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);