Whamcloud - gitweb
LU-17504 build: fix gcc-13 [-Werror=stringop-overread] error
[fs/lustre-release.git] / lustre / ptlrpc / nodemap_member.c
index 5070807..2227e66 100644 (file)
@@ -176,12 +176,12 @@ void nm_member_reclassify_nodemap(struct lu_nodemap *nodemap)
 
        list_for_each_entry_safe(exp, tmp, &nodemap->nm_member_list,
                                 exp_target_data.ted_nodemap_member) {
-               lnet_nid_t nid;
+               struct lnet_nid *nid;
 
                /* if no conn assigned to this exp, reconnect will reclassify */
                spin_lock(&exp->exp_lock);
                if (exp->exp_connection) {
-                       nid = exp->exp_connection->c_peer.nid;
+                       nid = &exp->exp_connection->c_peer.nid;
                } else {
                        spin_unlock(&exp->exp_lock);
                        continue;
@@ -213,7 +213,9 @@ void nm_member_reclassify_nodemap(struct lu_nodemap *nodemap)
                        list_add(&exp->exp_target_data.ted_nodemap_member,
                                 &new_nodemap->nm_member_list);
                        mutex_unlock(&new_nodemap->nm_member_list_lock);
-                       nm_member_exp_revoke(exp);
+
+                       if (nodemap_active)
+                               nm_member_exp_revoke(exp);
                } else {
                        nodemap_putref(new_nodemap);
                }
@@ -224,15 +226,24 @@ void nm_member_reclassify_nodemap(struct lu_nodemap *nodemap)
 }
 
 /**
- * Revoke the locks for member exports. Changing the idmap is
- * akin to deleting the security context. If the locks are not
- * canceled, the client could cache permissions that are no
- * longer correct with the map.
+ * Revoke the locks for member exports if nodemap system is active.
+ *
+ * Changing the idmap is akin to deleting the security context. If the locks
+ * are not canceled, the client could cache permissions that are no longer
+ * correct with the map.
  *
  * \param      nodemap         nodemap that has been altered
  */
 void nm_member_revoke_locks(struct lu_nodemap *nodemap)
 {
+       if (!nodemap_active)
+               return;
+
+       nm_member_revoke_locks_always(nodemap);
+}
+
+void nm_member_revoke_locks_always(struct lu_nodemap *nodemap)
+{
        struct obd_export *exp;
        struct obd_export *tmp;