From f9e014247d5667c2282096cc2d23fb878722711a Mon Sep 17 00:00:00 2001 From: nathan <nathan> Date: Tue, 16 Oct 2007 21:23:04 +0000 Subject: [PATCH] b=11778 i=shadow i=adilger remove client blocking for ost connection (since the earlier 11778 patch didn't land on head anyhow, really this is just syncing to b1_6, without changing functionality.) --- lustre/include/obd.h | 7 ++++--- lustre/mds/mds_lov.c | 18 +++++++++++++++--- lustre/obdclass/obd_mount.c | 4 ++-- lustre/tests/conf-sanity.sh | 3 --- lustre/tests/sanity.sh | 1 + 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 5d1fe3b9e5..119469c081 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -524,7 +524,6 @@ struct mds_obd { struct lov_desc mds_lov_desc; __u32 mds_id; - unsigned int mds_lov_objids_dirty:1; struct file *mds_lov_objid_filp; /* protect update vs free in lov_add_target */ struct rw_semaphore mds_lov_objids_sem; @@ -544,10 +543,12 @@ struct mds_obd { struct semaphore mds_qonoff_sem; struct semaphore mds_health_sem; unsigned long mds_lov_objids_valid:1, + mds_lov_objids_dirty:1, mds_fl_user_xattr:1, mds_fl_acl:1, - mds_evict_ost_nids:1; - + mds_evict_ost_nids:1, + mds_fl_cfglog:1, + mds_fl_synced:1; struct upcall_cache *mds_identity_cache; struct upcall_cache *mds_rmtacl_cache; diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 7688a2d8fd..07a47a4ad8 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -91,7 +91,7 @@ static int mds_lov_read_objids(struct obd_device *obd) rc = fsfilt_read_record(obd, mds->mds_lov_objid_filp, ids, size, &off); if (rc < 0) { - OBD_FREE(ids, size); + OBD_FREE(ids, size); CERROR("Error reading objids %d\n", rc); GOTO(out, rc); } @@ -692,6 +692,18 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, } +/* Collect the preconditions we need to allow client connects */ +static void mds_allow_cli(struct obd_device *obd, unsigned int flag) +{ + if (flag & CONFIG_LOG) + obd->u.mds.mds_fl_cfglog = 1; + if (flag & CONFIG_SYNC) + obd->u.mds.mds_fl_synced = 1; + if (obd->u.mds.mds_fl_cfglog /* bz11778: && obd->u.mds.mds_fl_synced */) + /* Open for clients */ + obd->obd_no_conn = 0; +} + struct mds_lov_sync_info { struct obd_device *mlsi_obd; /* the lov device to sync */ struct obd_device *mlsi_watched; /* target osc */ @@ -887,8 +899,7 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched, case OBD_NOTIFY_SYNC_NONBLOCK: break; case OBD_NOTIFY_CONFIG: - /* Open for clients */ - obd->obd_no_conn = 0; + mds_allow_cli(obd, (unsigned int)data); default: RETURN(0); } @@ -919,6 +930,7 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched, obd->u.mds.mds_lov_desc.ld_tgt_count, &watched->u.cli.cl_target_uuid); mutex_up(&obd->obd_dev_sem); + mds_allow_cli(obd, CONFIG_SYNC); RETURN(rc); } diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 202c740b5e..89572b5134 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -750,8 +750,8 @@ static int lustre_stop_mgc(struct super_block *sb) { struct lustre_sb_info *lsi = s2lsi(sb); struct obd_device *obd; - char *niduuid, *ptr = 0; - int i, rc = 0, len; + char *niduuid = 0, *ptr = 0; + int i, rc = 0, len = 0; ENTRY; if (!lsi) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 2056f1e3b7..d36a22ca7c 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -299,8 +299,6 @@ run_test 5d "mount with ost down" test_5e() { start_ost start_mds - # give MDS a chance to connect to OSTs (bz 10476) - sleep 5 #define OBD_FAIL_PTLRPC_DELAY_SEND 0x506 do_facet client "sysctl -w lustre.fail_loc=0x80000506" @@ -787,7 +785,6 @@ test_22() { echo Client mount with a running ost start_ost mount_client $MOUNT - sleep 5 #bz10476 check_mount || return 41 pass diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index ff0a2173ab..d7d277121e 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2165,6 +2165,7 @@ test_51() { FNUM=$(($FNUM + 1)) echo -n "+" done + echo ls -l $DIR/d51 > /dev/null || error } run_test 51 "special situations: split htree with empty entry ==" -- GitLab