Whamcloud - gitweb
LU-8402 ldlm: assume OBD_CONNECT_IBITS 09/30009/3
authorJohn L. Hammond <john.hammond@intel.com>
Wed, 8 Nov 2017 15:44:51 +0000 (09:44 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 1 Dec 2017 05:16:05 +0000 (05:16 +0000)
Clients and MDSs have supported and required OBD_CONNECT_IBITS since
before 1.6 so remove obsolete code to handle clients that do not
support this flag.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I24a623b063c518755b81d02fc48fa0f76aacd318
Reviewed-on: https://review.whamcloud.com/30009
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/mdt/mdt_handler.c
lustre/ptlrpc/import.c

index 2887ef9..313e2eb 100644 (file)
@@ -737,7 +737,7 @@ struct ptlrpc_body_v2 {
 #define OBD_CONNECT_LARGE_ACL          0x200ULL /* more than 32 ACL entries */
 #define OBD_CONNECT_TRUNCLOCK           0x400ULL /*locks on server for punch */
 #define OBD_CONNECT_TRANSNO             0x800ULL /*replay sends init transno */
-#define OBD_CONNECT_IBITS              0x1000ULL /*support for inodebits locks*/
+#define OBD_CONNECT_IBITS             0x1000ULL /* not checked in 2.11+ */
 #define OBD_CONNECT_BARRIER           0x2000ULL /* write barrier */
 #define OBD_CONNECT_ATTRFID            0x4000ULL /*Server can GetAttr By Fid*/
 #define OBD_CONNECT_NODEVOH            0x8000ULL /*No open hndl on specl nodes*/
@@ -890,8 +890,8 @@ struct ptlrpc_body_v2 {
 #define MGS_CONNECT_SUPPORTED2 0
 
 /* Features required for this version of the client to work with server */
-#define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_IBITS | OBD_CONNECT_FID | \
-                                 OBD_CONNECT_FULL20)
+#define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_FID |     \
+                                OBD_CONNECT_FULL20)
 
 /* This structure is used for both request and reply.
  *
index b96396a..0591eb0 100644 (file)
@@ -1229,20 +1229,6 @@ int ldlm_handle_enqueue0(struct ldlm_namespace *ns,
                 GOTO(out, rc = -EFAULT);
         }
 
-       if (exp_connect_flags(req->rq_export) & OBD_CONNECT_IBITS) {
-                if (unlikely(dlm_req->lock_desc.l_resource.lr_type ==
-                             LDLM_PLAIN)) {
-                        DEBUG_REQ(D_ERROR, req,
-                                  "PLAIN lock request from IBITS client?");
-                        GOTO(out, rc = -EPROTO);
-                }
-        } else if (unlikely(dlm_req->lock_desc.l_resource.lr_type ==
-                            LDLM_IBITS)) {
-                DEBUG_REQ(D_ERROR, req,
-                          "IBITS lock request from unaware client?");
-                GOTO(out, rc = -EPROTO);
-        }
-
        if (unlikely((flags & LDLM_FL_REPLAY) ||
                     (lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT))) {
                 /* Find an existing lock in the per-export lock hash */
index 859568d..f570797 100644 (file)
@@ -670,14 +670,15 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
                                GOTO(cleanup, rc = -ENOMEM);
                        LDLM_DEBUG(lock, "client-side enqueue, new resource");
                }
-               if (with_policy)
-                       if (!(type == LDLM_IBITS &&
-                             !(exp_connect_flags(exp) & OBD_CONNECT_IBITS)))
-                               /* We assume lock type cannot change on server*/
-                               ldlm_convert_policy_to_local(exp,
+
+               if (with_policy) {
+                       /* We assume lock type cannot change on server*/
+                       ldlm_convert_policy_to_local(exp,
                                                lock->l_resource->lr_type,
                                                &reply->lock_desc.l_policy_data,
                                                &lock->l_policy_data);
+               }
+
                 if (type != LDLM_PLAIN)
                         LDLM_DEBUG(lock,"client-side enqueue, new policy data");
         }
index 625fa0b..c796c15 100644 (file)
@@ -5549,15 +5549,6 @@ static int mdt_connect_internal(const struct lu_env *env,
 
        data->ocd_ibits_known &= MDS_INODELOCK_FULL;
 
-       if (!(data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
-           !(data->ocd_connect_flags & OBD_CONNECT_IBITS)) {
-               CWARN("%s: client %s does not support ibits lock, either "
-                     "very old or an invalid client: flags %#llx\n",
-                     mdt_obd_name(mdt), exp->exp_client_uuid.uuid,
-                     data->ocd_connect_flags);
-               return -EBADE;
-       }
-
        if (!mdt->mdt_opts.mo_acl)
                data->ocd_connect_flags &= ~OBD_CONNECT_ACL;
 
index 46908ba..bc44747 100644 (file)
@@ -801,18 +801,6 @@ static int ptlrpc_connect_set_flags(struct obd_import *imp,
        static bool warned;
        struct client_obd *cli = &imp->imp_obd->u.cli;
 
-       if ((imp->imp_connect_flags_orig & OBD_CONNECT_IBITS) &&
-           !(ocd->ocd_connect_flags & OBD_CONNECT_IBITS)) {
-               LCONSOLE_WARN("%s: MDS %s does not support ibits "
-                             "lock, either very old or invalid: "
-                             "requested %#llx, replied %#llx\n",
-                             imp->imp_obd->obd_name,
-                             imp->imp_connection->c_remote_uuid.uuid,
-                             imp->imp_connect_flags_orig,
-                             ocd->ocd_connect_flags);
-               return -EPROTO;
-       }
-
        spin_lock(&imp->imp_lock);
        list_del(&imp->imp_conn_current->oic_item);
        list_add(&imp->imp_conn_current->oic_item,