Whamcloud - gitweb
LU-8402 ldlm: assume OBD_CONNECT_IBITS 27/34027/2
authorHongchao Zhang <hongchao@whamcloud.com>
Wed, 26 Dec 2018 17:21:47 +0000 (12:21 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 1 Feb 2019 18:20:19 +0000 (18:20 +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.

Lustre-change: https://review.whamcloud.com/30009
Lustre-commit: c7a833830de691967081cd7a42199b924ea7efdc

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

index 1a2180b..7f789c5 100644 (file)
@@ -722,7 +722,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*/
@@ -870,8 +870,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 356a302..587122e 100644 (file)
@@ -1267,20 +1267,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 94aacc8..8e7ecfc 100644 (file)
@@ -671,14 +671,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 3fb9f6e..24e821e 100644 (file)
@@ -5332,15 +5332,6 @@ static int mdt_connect_internal(struct obd_export *exp,
 
        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 8338095..6851cec 100644 (file)
@@ -796,18 +796,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,