Whamcloud - gitweb
LU-18057 mdt: don't include DOM bit to stripes lock 28/55828/3
authorMikhail Pershin <mpershin@whamcloud.com>
Mon, 22 Jul 2024 08:50:06 +0000 (11:50 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 8 Aug 2024 00:17:58 +0000 (00:17 +0000)
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>
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_reint.c
lustre/mdt/mdt_restripe.c
lustre/mdt/mdt_xattr.c

index 7767191..91d1328 100644 (file)
@@ -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;
index e123f00..aadde45 100644 (file)
@@ -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);
 
index e09645e..656b5cf 100644 (file)
@@ -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);
 
index 42424f8..f2f1c47 100644 (file)
@@ -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);