From 2bc39a18041e40821195ef445269b282a9ec8fdb Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Wed, 26 Dec 2018 12:21:47 -0500 Subject: [PATCH] LU-8402 ldlm: assume OBD_CONNECT_IBITS 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 Reviewed-on: https://review.whamcloud.com/30009 Reviewed-by: Andreas Dilger Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin Signed-off-by: Hongchao Zhang Reviewed-on: https://review.whamcloud.com/34027 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/include/lustre/lustre_idl.h | 6 +++--- lustre/ldlm/ldlm_lockd.c | 14 -------------- lustre/ldlm/ldlm_request.c | 11 ++++++----- lustre/mdt/mdt_handler.c | 9 --------- lustre/ptlrpc/import.c | 12 ------------ 5 files changed, 9 insertions(+), 43 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 1a2180b..7f789c5 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -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. * diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 356a302..587122e 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -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 */ diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 94aacc8..8e7ecfc 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -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"); } diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 3fb9f6e..24e821e 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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; diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 8338095..6851cec 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -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, -- 1.8.3.1