From 3fe77a129e131014ff654bde616a62a1e243e322 Mon Sep 17 00:00:00 2001 From: Alexander Boyko Date: Wed, 11 Mar 2020 06:40:52 -0400 Subject: [PATCH] LU-13356 client: don't use OBD_CONNECT_MNE_SWAB OBD_CONNECT_MNE_SWAB is equal to OBD_CONNECT_MDS_MDS, and it was used at MGC client in past for mne swabbing during interop. Right now it is interpreted at MGS like OBD_CONNECT_MDS_MDS and skip these clients from eviction and lock canceling after timeout. Fixes: 1bdc4fd0594e ("LU-6307 obdclass: distinguish MGC/MDT connection properly") Test-Parameters: testlist=runtests clientversion=2.12 envdefinitions=MDS_MOUNT_OPTS="-orw",OST_MOUNT_OPTS="-orw" Test-Parameters: testlist=runtests serverversion=2.12 envdefinitions=MDS_MOUNT_OPTS="-orw",OST_MOUNT_OPTS="-orw" Test-Parameters: testlist=runtests clientversion=2.10 clientdistro=el7.6 envdefinitions=MDS_MOUNT_OPTS="-orw",OST_MOUNT_OPTS="-orw" Test-Parameters: testlist=runtests serverversion=2.10 serverdistro=el7.6 envdefinitions=MDS_MOUNT_OPTS="-orw",OST_MOUNT_OPTS="-orw" Signed-off-by: Alexander Boyko Cray-bug-id: LUS-8484 Change-Id: I4f8ddeb1808cfaee7507e0efcdefa24040cfcbb6 Reviewed-on: https://review.whamcloud.com/37880 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Artem Blagodarenko Reviewed-by: Oleg Drokin --- lustre/include/uapi/linux/lustre/lustre_idl.h | 8 +------- lustre/ldlm/ldlm_lib.c | 4 ++-- lustre/mgs/mgs_llog.c | 20 +++++++++----------- lustre/obdclass/obd_mount.c | 4 ---- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 1402fbb..1dc835f 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -849,12 +849,6 @@ struct ptlrpc_body_v2 { * to reserve the flag for future use. */ -/* The MNE_SWAB flag is overloading the MDS_MDS bit only for the MGS - * connection. It is a temporary bug fix for Imperative Recovery interop - * between 2.2 and 2.3 x86/ppc nodes, and can be removed when interop for - * 2.2 clients/servers is no longer needed. LU-1252/LU-1644. */ -#define OBD_CONNECT_MNE_SWAB OBD_CONNECT_MDS_MDS - #define OCD_HAS_FLAG(ocd, flg) \ (!!((ocd)->ocd_connect_flags & OBD_CONNECT_##flg)) @@ -929,7 +923,7 @@ struct ptlrpc_body_v2 { #define MGS_CONNECT_SUPPORTED (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \ OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV | \ - OBD_CONNECT_MNE_SWAB | OBD_CONNECT_PINGLESS |\ + OBD_CONNECT_PINGLESS |\ OBD_CONNECT_BULK_MBITS | OBD_CONNECT_BARRIER) #define MGS_CONNECT_SUPPORTED2 0 diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 038da9e..4943301 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1138,8 +1138,8 @@ int target_handle_connect(struct ptlrpc_request *req) OBD_CONNECT_MDS_MDS) != 0; /* - * OBD_CONNECT_MNE_SWAB is defined as OBD_CONNECT_MDS_MDS - * for Imperative Recovery connection from MGC to MGS. + * OBD_CONNECT_MNE_SWAB is removed at 2.14 + * Checking OBD_CONNECT_FID can be removed in the future. * * Via check OBD_CONNECT_FID, we can distinguish whether * the OBD_CONNECT_MDS_MDS/OBD_CONNECT_MNE_SWAB is from diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 3341cd3..1e37173 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -1513,23 +1513,21 @@ static int only_mgs_is_running(struct obd_device *mgs_obd) /* skip self export */ if (exp == mgs_obd->obd_self_export) continue; - if (exp_connect_flags(exp) & OBD_CONNECT_MDS_MDS) - continue; ++num_exports; - CERROR("%s: node %s still connected during replace_nids " - "connect_flags:%llx\n", - mgs_obd->obd_name, - libcfs_nid2str(exp->exp_nid_stats->nid), - exp_connect_flags(exp)); - + if (num_exports > 1) + CERROR("%s: node %s still connected during replace_nids connect_flags:%llx\n", + mgs_obd->obd_name, + libcfs_nid2str(exp->exp_nid_stats->nid), + exp_connect_flags(exp)); } spin_unlock(&mgs_obd->obd_dev_lock); - /* osd, MGS and MGC + self_export - (wc -l /proc/fs/lustre/devices <= 2) && (non self exports == 0) */ - return (num_devices <= 3) && (num_exports == 0); + /* osd, MGS and MGC + MGC export (nosvc starts MGC) + * (wc -l /proc/fs/lustre/devices <= 3) && (non self exports == 1) + */ + return (num_devices <= 3) && (num_exports <= 1); } static int name_create_mdt(char **logname, char *fsname, int mdt_idx) diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 62e1de8..de23440 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -469,10 +469,6 @@ int lustre_start_mgc(struct super_block *sb) OBD_CONNECT_LVB_TYPE | OBD_CONNECT_BULK_MBITS | OBD_CONNECT_BARRIER; -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 53, 0) - data->ocd_connect_flags |= OBD_CONNECT_MNE_SWAB; -#endif - if (lmd_is_client(lsi->lsi_lmd) && lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR) data->ocd_connect_flags &= ~OBD_CONNECT_IMP_RECOV; -- 1.8.3.1