Whamcloud - gitweb
- set in cmm mdc devices obd flags from mdt_obd in shutdown case. That should fix...
authoryury <yury>
Fri, 13 Oct 2006 18:08:57 +0000 (18:08 +0000)
committeryury <yury>
Fri, 13 Oct 2006 18:08:57 +0000 (18:08 +0000)
- show obd_name in fld_client_add_target() as it is more understandable (needed for debug, seems fld targets on diff. nodes may have diff. order what is cause of really bad issues);

lustre/cmm/cmm_object.c
lustre/cmm/cmm_split.c
lustre/cmm/mdc_device.c
lustre/fid/fid_request.c
lustre/fld/fld_internal.h
lustre/fld/fld_request.c
lustre/lmv/lmv_intent.c
lustre/lmv/lmv_obd.c

index 86c8714..a943593 100644 (file)
@@ -51,7 +51,7 @@ static int cmm_fld_lookup(struct cmm_device *cm,
         rc = fld_client_lookup(ls->ls_client_fld,
                                fid_seq(fid), mds, env);
         if (rc) {
-                CERROR("can't find mds by seq "LPX64", rc %d\n",
+                CERROR("Can't find mds by seq "LPX64", rc %d\n",
                        fid_seq(fid), rc);
                 RETURN(rc);
         }
index d466827..18d59c2 100644 (file)
@@ -80,10 +80,11 @@ static int cmm_expect_splitting(const struct lu_env *env,
         if (lu_fid_eq(fid, cmm2_fid(md2cmm_obj(mo))))
                 GOTO(cleanup, rc = CMM_NO_SPLIT_EXPECTED);
 
+        EXIT;
 cleanup:
         if (fid)
                 OBD_FREE_PTR(fid);
-        RETURN(rc);
+        return rc;
 }
 
 #define cmm_md_size(stripes) \
index ed8628e..84e4f23 100644 (file)
@@ -138,27 +138,30 @@ static int mdc_del_obd(struct mdc_device *mc)
 {
         struct mdc_cli_desc *desc = &mc->mc_desc;
         struct obd_device *mdc_obd = class_exp2obd(desc->cl_exp);
+        struct obd_device *mdt_obd;
         int rc;
 
         ENTRY;
 
-        CDEBUG(D_CONFIG, "disconnect from %s\n",
+        CDEBUG(D_CONFIG, "Disconnect from %s\n",
                mdc_obd->obd_name);
 
+        /* Set mdt_obd flags in shutdown. */
+        if (mdc_obd) {
+                mdt_obd = mc->mc_md_dev.md_lu_dev.ld_obd;
+                mdc_obd->obd_no_recov = mdt_obd->obd_no_recov;
+                mdc_obd->obd_force = mdt_obd->obd_force;
+                mdc_obd->obd_fail = mdt_obd->obd_fail;
+        }
+
         rc = obd_fid_fini(desc->cl_exp);
         if (rc)
-                CERROR("fid init error %d \n", rc);
+                CERROR("Fid fini error %d\n", rc);
 
         obd_register_observer(mdc_obd, NULL);
-
-        /*TODO: Give the same shutdown flags as we have */
-        /*
-        desc->cl_exp->exp_obd->obd_force = mdt_obd->obd_force;
-        desc->cl_exp->exp_obd->obd_fail = mdt_obd->obd_fail;
-        */
         rc = obd_disconnect(desc->cl_exp);
         if (rc) {
-                CERROR("target %s disconnect error %d\n",
+                CERROR("Target %s disconnect error %d\n",
                        mdc_obd->obd_name, rc);
         }
         class_manual_cleanup(mdc_obd);
@@ -168,7 +171,8 @@ static int mdc_del_obd(struct mdc_device *mc)
 }
 
 static int mdc_process_config(const struct lu_env *env,
-                              struct lu_device *ld, struct lustre_cfg *cfg)
+                              struct lu_device *ld,
+                              struct lustre_cfg *cfg)
 {
         struct mdc_device *mc = lu2mdc_dev(ld);
         int rc;
@@ -218,17 +222,29 @@ struct lu_device *mdc_device_alloc(const struct lu_env *env,
                                    struct lu_device_type *ldt,
                                    struct lustre_cfg *cfg)
 {
+        const char        *dev = lustre_cfg_string(cfg, 0);
+        struct obd_device *mdt_obd;
         struct lu_device  *ld;
         struct mdc_device *mc;
-
         ENTRY;
 
+        mdt_obd = class_name2obd(dev);
+        LASSERT(mdt_obd != NULL);
+        
         OBD_ALLOC_PTR(mc);
         if (mc == NULL) {
                 ld = ERR_PTR(-ENOMEM);
         } else {
                 md_device_init(&mc->mc_md_dev, ldt);
-                mc->mc_md_dev.md_ops =  &mdc_md_ops;
+                mc->mc_md_dev.md_ops = &mdc_md_ops;
+
+                /* 
+                 * ld_obd is not used for MDC obd in cmm as it has own
+                 * descriptor for each device. So we use it for saving mdt_obd
+                 * to access it later in shutdown to set odb_fail,
+                 * obd_no_recover, etc., flags.  --umka
+                 */
+                mc->mc_md_dev.md_lu_dev.ld_obd = mdt_obd;
                ld = mdc2lu_dev(mc);
                 ld->ld_ops = &mdc_lu_ops;
         }
@@ -239,7 +255,8 @@ void mdc_device_free(const struct lu_env *env, struct lu_device *ld)
 {
         struct mdc_device *mc = lu2mdc_dev(ld);
 
-       LASSERTF(atomic_read(&ld->ld_ref) == 0, "Refcount = %i\n", atomic_read(&ld->ld_ref));
+       LASSERTF(atomic_read(&ld->ld_ref) == 0,
+                 "Refcount = %i\n", atomic_read(&ld->ld_ref));
         LASSERT(list_empty(&mc->mc_linkage));
        md_device_fini(&mc->mc_md_dev);
         OBD_FREE_PTR(mc);
index c4d22e8..0884809 100644 (file)
@@ -218,7 +218,7 @@ static int __seq_client_alloc_seq(struct lu_client_seq *seq, seqno_t *seqnr)
                                "rc %d\n", seq->lcs_name, rc);
                         RETURN(rc);
                 } else {
-                        CDEBUG(D_INFO|D_WARNING, "%s: New range - "DRANGE"\n",
+                        CDEBUG(D_INFO, "%s: New range - "DRANGE"\n",
                                seq->lcs_name, PRANGE(&seq->lcs_space));
                 }
         }
index 8f7e381..ecf9907 100644 (file)
@@ -91,7 +91,7 @@ fld_target_name(struct lu_fld_target *tar)
         if (tar->ft_srv != NULL)
                 return tar->ft_srv->lsf_name;
 
-        return tar->ft_exp->exp_client_uuid.uuid;
+        return (const char *)tar->ft_exp->exp_obd->obd_name;
 }
 
 extern cfs_proc_dir_entry_t *fld_type_proc_dir;
index 4a025fb..5b19eb1 100644 (file)
@@ -141,6 +141,12 @@ fld_client_get_target(struct lu_client_fld *fld,
         target = fld->lcf_hash->fh_scan_func(fld, seq);
         spin_unlock(&fld->lcf_lock);
 
+        if (target != NULL) {
+                CDEBUG(D_INFO, "%s: Found target (idx "LPU64
+                       ") by seq "LPX64"\n", fld->lcf_name,
+                       target->ft_idx, seq);
+        }
+
         RETURN(target);
 }
 
index 968b68c..2f3b296 100644 (file)
@@ -254,7 +254,7 @@ repeat:
                         it->d.lustre.it_data = 0;
                         *reqp = NULL;
 
-                       /* We shoudld reallocate the FID for the object */
+                        /* We shoudld reallocate the FID for the object */
                         rc = lmv_alloc_fid_for_split(obd, &rpid, op_data,
                                                      &sop_data->fid2);
                         if (rc)
index c68258b..110ccca 100644 (file)
@@ -854,10 +854,10 @@ static int lmv_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
                 RETURN(rc);
         }
 
-        /* asking underlaying tgt layer to allocate new fid */
+        /* Asking underlaying tgt layer to allocate new fid. */
         rc = obd_fid_alloc(lmv->tgts[mds].ltd_exp, fid, hint);
 
-        /* client switches to new sequence, setup fld */
+        /* Client switches to new sequence, setup fld. */
         if (rc > 0) {
                 LASSERT(fid_is_sane(fid));