From 89ea3bcfe6d5f171892d11c58c6378e9842ab5d5 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Tue, 5 May 2020 09:05:08 +0800 Subject: [PATCH] LU-13522 mdt: count mdt_mds_mds_conns upon reconnect mdt.mdt_mds_mds_conns is inter-MDT connection count, it should be increased upon reconnect (MDT stop and start). Update sanityn 33c. Signed-off-by: Lai Siyao Change-Id: Ic0dabee10431f39665cb2bc4fa8a014fc78fbd60 Reviewed-on: https://review.whamcloud.com/38512 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_handler.c | 36 ++++++++++++++++++------------------ lustre/tests/sanityn.sh | 4 ++++ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 235cd89..2f069ff 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -5974,6 +5974,18 @@ static int mdt_obd_set_info_async(const struct lu_env *env, RETURN(0); } +static inline void mdt_enable_slc(struct mdt_device *mdt) +{ + if (mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_NEVER) + mdt->mdt_lut.lut_sync_lock_cancel = SYNC_LOCK_CANCEL_BLOCKING; +} + +static inline void mdt_disable_slc(struct mdt_device *mdt) +{ + if (mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_BLOCKING) + mdt->mdt_lut.lut_sync_lock_cancel = SYNC_LOCK_CANCEL_NEVER; +} + /** * Match client and server connection feature flags. * @@ -6134,6 +6146,12 @@ static int mdt_connect_internal(const struct lu_env *env, exp->exp_obd->obd_name, obd_export_nid2str(exp)); } + if ((data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) && + !(data->ocd_connect_flags & OBD_CONNECT_LIGHTWEIGHT)) { + atomic_inc(&mdt->mdt_mds_mds_conns); + mdt_enable_slc(mdt); + } + return 0; } @@ -6244,18 +6262,6 @@ static int mdt_export_cleanup(struct obd_export *exp) RETURN(rc); } -static inline void mdt_enable_slc(struct mdt_device *mdt) -{ - if (mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_NEVER) - mdt->mdt_lut.lut_sync_lock_cancel = SYNC_LOCK_CANCEL_BLOCKING; -} - -static inline void mdt_disable_slc(struct mdt_device *mdt) -{ - if (mdt->mdt_lut.lut_sync_lock_cancel == SYNC_LOCK_CANCEL_BLOCKING) - mdt->mdt_lut.lut_sync_lock_cancel = SYNC_LOCK_CANCEL_NEVER; -} - static int mdt_obd_disconnect(struct obd_export *exp) { int rc; @@ -6310,12 +6316,6 @@ static int mdt_obd_connect(const struct lu_env *env, mdt = mdt_dev(obd->obd_lu_dev); - if ((data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) && - !(data->ocd_connect_flags & OBD_CONNECT_LIGHTWEIGHT)) { - atomic_inc(&mdt->mdt_mds_mds_conns); - mdt_enable_slc(mdt); - } - /* * first, check whether the stack is ready to handle requests * XXX: probably not very appropriate method is used now diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 47216b9..8d2bdef 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -1084,6 +1084,10 @@ test_33c() { [ "$MDS1_VERSION" -lt $(version_code 2.7.63) ] && skip "DNE CoS not supported" + # LU-13522 + stop mds1 + start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS || error "start mds1 failed" + local sync_count mkdir $DIR/$tdir -- 1.8.3.1