From d19ca58d0d1d6905d2faca67c52c161c17f5eb4a Mon Sep 17 00:00:00 2001 From: nikita Date: Wed, 25 Oct 2006 16:54:39 +0000 Subject: [PATCH] make lustre less noisy during normal operation. --- lustre/cmm/cmm_device.c | 26 +++++------ lustre/fid/fid_handler.c | 32 ++++++------- lustre/fid/fid_request.c | 8 ++-- lustre/fid/fid_store.c | 4 +- lustre/fid/lproc_fid.c | 12 ++--- lustre/fld/fld_cache.c | 18 ++++---- lustre/fld/fld_handler.c | 3 -- lustre/fld/fld_request.c | 15 +++--- lustre/fld/lproc_fld.c | 9 ++-- lustre/llite/super.c | 2 - lustre/llite/super25.c | 8 ++-- lustre/mdd/mdd_device.c | 3 +- lustre/mdt/mdt_handler.c | 4 +- lustre/obdclass/obd_mount.c | 110 ++++++++++++++++++++++---------------------- lustre/obdfilter/filter.c | 4 +- 15 files changed, 118 insertions(+), 140 deletions(-) diff --git a/lustre/cmm/cmm_device.c b/lustre/cmm/cmm_device.c index 3d28829..a0dced4 100644 --- a/lustre/cmm/cmm_device.c +++ b/lustre/cmm/cmm_device.c @@ -123,14 +123,14 @@ static struct md_device_operations cmm_md_ops = { extern struct lu_device_type mdc_device_type; -static int cmm_post_init_mdc(const struct lu_env *env, +static int cmm_post_init_mdc(const struct lu_env *env, struct cmm_device *cmm) { int max_mdsize, max_cookiesize, rc; struct mdc_device *mc, *tmp; /* get the max mdsize and cookiesize from lower layer */ - rc = cmm_maxsize_get(env, &cmm->cmm_md_dev, &max_mdsize, + rc = cmm_maxsize_get(env, &cmm->cmm_md_dev, &max_mdsize, &max_cookiesize); if (rc) RETURN(rc); @@ -140,7 +140,7 @@ static int cmm_post_init_mdc(const struct lu_env *env, mc_linkage) { mdc_init_ea_size(env, mc, max_mdsize, max_cookiesize); } - spin_unlock(&cmm->cmm_tgt_guard); + spin_unlock(&cmm->cmm_tgt_guard); RETURN(rc); } @@ -209,7 +209,7 @@ static int cmm_add_mdc(const struct lu_env *env, target.ft_idx = mc->mc_num; target.ft_exp = mc->mc_desc.cl_exp; fld_client_add_target(cm->cmm_fld, &target); - + /* Set max md size for the mdc. */ rc = cmm_post_init_mdc(env, cm); RETURN(rc); @@ -276,11 +276,11 @@ static int cmm_process_config(const struct lu_env *env, fld_client_add_target(m->cmm_fld, &target); } err = cmm_add_mdc(env, m, cfg); - + /* The first ADD_MDC can be counted as setup is finished. */ if (!(m->cmm_flags & CMM_INITIALIZED)) m->cmm_flags |= CMM_INITIALIZED; - + break; case LCFG_SETUP: { @@ -330,11 +330,11 @@ int cmm_upcall(const struct lu_env *env, struct md_device *md, LASSERT(upcall_dev); switch (ev) { case MD_LOV_SYNC: - rc = cmm_post_init_mdc(env, md2cmm_dev(md)); - if (rc) + rc = cmm_post_init_mdc(env, md2cmm_dev(md)); + if (rc) CERROR("can not init md size %d\n", rc); default: - rc = upcall_dev->md_upcall.mu_upcall(env, + rc = upcall_dev->md_upcall.mu_upcall(env, md->md_upcall.mu_upcall_dev, ev); } RETURN(rc); @@ -428,7 +428,7 @@ static void cmm_type_fini(struct lu_device_type *t) lu_context_key_degister(&cmm_thread_key); } -static int cmm_device_init(const struct lu_env *env, struct lu_device *d, +static int cmm_device_init(const struct lu_env *env, struct lu_device *d, const char *name, struct lu_device *next) { struct cmm_device *m = lu2cmm_dev(d); @@ -451,7 +451,7 @@ static int cmm_device_init(const struct lu_env *env, struct lu_device *d, /* Assign site's fld client ref, needed for asserts in osd. */ ls = cmm2lu_dev(m)->ld_site; ls->ls_client_fld = m->cmm_fld; - + RETURN(err); } @@ -479,7 +479,7 @@ static struct lu_device *cmm_device_fini(const struct lu_env *env, fld_client_fini(cm->cmm_fld); ls = cmm2lu_dev(cm)->ld_site; ls->ls_client_fld = NULL; - + RETURN (md2lu_dev(cm->cmm_child)); } @@ -515,8 +515,6 @@ static int __init cmm_mod_init(void) { struct lprocfs_static_vars lvars; - printk(KERN_INFO "Lustre: Clustered Metadata Manager; info@clusterfs.com\n"); - lprocfs_init_vars(cmm, &lvars); return class_register_type(&cmm_obd_device_ops, NULL, lvars.module_vars, LUSTRE_CMM_NAME, &cmm_device_type); diff --git a/lustre/fid/fid_handler.c b/lustre/fid/fid_handler.c index ffb2f02..972c9c6 100644 --- a/lustre/fid/fid_handler.c +++ b/lustre/fid/fid_handler.c @@ -63,9 +63,8 @@ int seq_server_set_cli(struct lu_server_seq *seq, down(&seq->lss_sem); if (cli == NULL) { - CDEBUG(D_INFO|D_WARNING, "%s: Detached " - "sequence client %s\n", seq->lss_name, - cli->lcs_name); + CDEBUG(D_INFO, "%s: Detached sequence client %s\n", + seq->lss_name, cli->lcs_name); seq->lss_cli = cli; GOTO(out_up, rc = 0); } @@ -76,8 +75,8 @@ int seq_server_set_cli(struct lu_server_seq *seq, GOTO(out_up, rc = -EINVAL); } - CDEBUG(D_INFO|D_WARNING, "%s: Attached sequence " - "controller %s\n", seq->lss_name, cli->lcs_name); + CDEBUG(D_INFO, "%s: Attached sequence controller %s\n", + seq->lss_name, cli->lcs_name); seq->lss_cli = cli; EXIT; @@ -102,14 +101,14 @@ static int __seq_server_alloc_super(struct lu_server_seq *seq, LASSERT(range_is_sane(space)); if (in != NULL) { - CDEBUG(D_INFO|D_WARNING, "%s: Input seq range: " + CDEBUG(D_INFO, "%s: Input seq range: " DRANGE"\n", seq->lss_name, PRANGE(in)); if (in->lr_end > space->lr_start) space->lr_start = in->lr_end; *out = *in; - CDEBUG(D_INFO|D_WARNING, "%s: Recovered space: "DRANGE"\n", + CDEBUG(D_INFO, "%s: Recovered space: "DRANGE"\n", seq->lss_name, PRANGE(space)); } else { if (range_space(space) < seq->lss_width) { @@ -171,7 +170,7 @@ static int __seq_server_alloc_meta(struct lu_server_seq *seq, * it is allocated from new super. */ if (in != NULL) { - CDEBUG(D_INFO|D_WARNING, "%s: Input seq range: " + CDEBUG(D_INFO, "%s: Input seq range: " DRANGE"\n", seq->lss_name, PRANGE(in)); if (range_is_exhausted(space)) { @@ -182,14 +181,14 @@ static int __seq_server_alloc_meta(struct lu_server_seq *seq, */ LASSERT(in->lr_end > space->lr_start); - /* + /* * Start is set to end of last allocated, because it * *is* already allocated so we take that into account * and do not use for other allocations. */ space->lr_start = in->lr_end; - /* + /* * End is set to in->lr_start + super sequence * allocation unit. That is because in->lr_start is * first seq in new allocated range from controller @@ -203,7 +202,7 @@ static int __seq_server_alloc_meta(struct lu_server_seq *seq, RETURN(-ENODEV); } - /* + /* * Let controller know that this is recovery and last * obtained range from it was @space. */ @@ -224,7 +223,7 @@ static int __seq_server_alloc_meta(struct lu_server_seq *seq, *out = *in; - CDEBUG(D_INFO|D_WARNING, "%s: Recovered space: "DRANGE"\n", + CDEBUG(D_INFO, "%s: Recovered space: "DRANGE"\n", seq->lss_name, PRANGE(space)); } else { /* @@ -249,7 +248,7 @@ static int __seq_server_alloc_meta(struct lu_server_seq *seq, *space = seq->lss_cli->lcs_space; LASSERT(range_is_sane(space)); } - + range_alloc(out, space, seq->lss_width); } @@ -516,13 +515,13 @@ int seq_server_init(struct lu_server_seq *seq, /* Request backing store for saved sequence info. */ rc = seq_store_read(seq, env); if (rc == -ENODATA) { - + /* Nothing is read, init by default value. */ seq->lss_space = is_srv ? LUSTRE_SEQ_ZERO_RANGE: LUSTRE_SEQ_SPACE_RANGE; - CDEBUG(D_INFO|D_WARNING, "%s: No data found " + CDEBUG(D_INFO, "%s: No data found " "on store. Initialize space\n", seq->lss_name); @@ -573,9 +572,6 @@ cfs_proc_dir_entry_t *seq_type_proc_dir = NULL; static int __init fid_mod_init(void) { - printk(KERN_INFO "Lustre: Sequence Manager; " - "info@clusterfs.com\n"); - seq_type_proc_dir = lprocfs_register(LUSTRE_SEQ_NAME, proc_lustre_root, NULL, NULL); diff --git a/lustre/fid/fid_request.c b/lustre/fid/fid_request.c index c5a79e9..7910135 100644 --- a/lustre/fid/fid_request.c +++ b/lustre/fid/fid_request.c @@ -135,7 +135,7 @@ int seq_client_replay_super(struct lu_client_seq *seq, ENTRY; down(&seq->lcs_sem); - + #ifdef __KERNEL__ if (seq->lcs_srv) { LASSERT(env != NULL); @@ -210,7 +210,7 @@ static int seq_client_alloc_seq(struct lu_client_seq *seq, seqno_t *seqnr) CDEBUG(D_INFO, "%s: Allocated sequence ["LPX64"]\n", seq->lcs_name, *seqnr); - + RETURN(rc); } @@ -238,7 +238,7 @@ int seq_client_alloc_fid(struct lu_client_seq *seq, struct lu_fid *fid) RETURN(rc); } - CDEBUG(D_INFO|D_WARNING, "%s: Switch to sequence " + CDEBUG(D_INFO, "%s: Switch to sequence " "[0x%16.16"LPF64"x]\n", seq->lcs_name, seqnr); seq->lcs_fid.f_oid = LUSTRE_FID_INIT_OID; @@ -255,7 +255,7 @@ int seq_client_alloc_fid(struct lu_client_seq *seq, struct lu_fid *fid) seq->lcs_fid.f_oid += 1; rc = 0; } - + *fid = seq->lcs_fid; up(&seq->lcs_sem); diff --git a/lustre/fid/fid_store.c b/lustre/fid/fid_store.c index fb4e93f..ceedf52 100644 --- a/lustre/fid/fid_store.c +++ b/lustre/fid/fid_store.c @@ -90,7 +90,7 @@ int seq_store_write(struct lu_server_seq *seq, seq_store_buf(info), &pos, th, BYPASS_CAPA); if (rc == sizeof(info->sti_space)) { - CDEBUG(D_INFO|D_WARNING, "%s: Space - "DRANGE"\n", + CDEBUG(D_INFO, "%s: Space - "DRANGE"\n", seq->lss_name, PRANGE(&seq->lss_space)); rc = 0; } else if (rc >= 0) { @@ -126,7 +126,7 @@ int seq_store_read(struct lu_server_seq *seq, if (rc == sizeof(info->sti_space)) { range_le_to_cpu(&seq->lss_space, &info->sti_space); - CDEBUG(D_INFO|D_WARNING, "%s: Space - "DRANGE"\n", + CDEBUG(D_INFO, "%s: Space - "DRANGE"\n", seq->lss_name, PRANGE(&seq->lss_space)); rc = 0; } else if (rc == 0) { diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c index e5692af..14323a7 100644 --- a/lustre/fid/lproc_fid.c +++ b/lustre/fid/lproc_fid.c @@ -101,7 +101,7 @@ seq_server_proc_write_space(struct file *file, const char *buffer, rc = seq_proc_write_common(file, buffer, count, data, &seq->lss_space); if (rc == 0) { - CDEBUG(D_WARNING, "%s: Sequences space has " + CDEBUG(D_INFO, "%s: Sequences space has " "changed to "DRANGE"\n", seq->lss_name, PRANGE(&seq->lss_space)); } @@ -169,9 +169,9 @@ seq_server_proc_write_width(struct file *file, const char *buffer, RETURN(rc); seq->lss_width = val; - + if (rc == 0) { - CDEBUG(D_WARNING, "%s: Allocation unit has changed to " + CDEBUG(D_INFO, "%s: Allocation unit has changed to " LPU64"\n", seq->lss_name, seq->lss_width); } @@ -213,7 +213,7 @@ seq_client_proc_write_space(struct file *file, const char *buffer, data, &seq->lcs_space); if (rc == 0) { - CDEBUG(D_WARNING, "%s: Sequences space has " + CDEBUG(D_INFO, "%s: Sequences space has " "changed to "DRANGE"\n", seq->lcs_name, PRANGE(&seq->lcs_space)); } @@ -259,9 +259,9 @@ seq_client_proc_write_width(struct file *file, const char *buffer, if (val <= LUSTRE_SEQ_MAX_WIDTH && val > 0) { seq->lcs_width = val; - + if (rc == 0) { - CDEBUG(D_WARNING, "%s: Sequence size: "LPU64"\n", + CDEBUG(D_INFO, "%s: Sequence size: "LPU64"\n", seq->lcs_name, seq->lcs_width); } } diff --git a/lustre/fld/fld_cache.c b/lustre/fld/fld_cache.c index 5d4d347..86ea531 100644 --- a/lustre/fld/fld_cache.c +++ b/lustre/fld/fld_cache.c @@ -92,7 +92,7 @@ struct fld_cache *fld_cache_init(const char *name, int hash_size, LASSERT(name != NULL); LASSERT(IS_PO2(hash_size)); LASSERT(cache_threshold < cache_size); - + OBD_ALLOC_PTR(cache); if (cache == NULL) RETURN(ERR_PTR(-ENOMEM)); @@ -121,8 +121,8 @@ struct fld_cache *fld_cache_init(const char *name, int hash_size, for (i = 0; i < hash_size; i++) INIT_HLIST_HEAD(&cache->fci_hash_table[i]); memset(&cache->fci_stat, 0, sizeof(cache->fci_stat)); - - CDEBUG(D_INFO|D_WARNING, "%s: FLD cache - Size: %d, Threshold: %d\n", + + CDEBUG(D_INFO, "%s: FLD cache - Size: %d, Threshold: %d\n", cache->fci_name, cache_size, cache_threshold); RETURN(cache); @@ -148,7 +148,7 @@ void fld_cache_fini(struct fld_cache *cache) printk(" Total reqs: "LPU64"\n", cache->fci_stat.fst_count); printk(" Cache reqs: "LPU64"\n", cache->fci_stat.fst_cache); printk(" Cache hits: "LPU64"%%\n", pct); - + OBD_FREE(cache->fci_hash_table, cache->fci_hash_size * sizeof(*cache->fci_hash_table)); OBD_FREE_PTR(cache); @@ -175,14 +175,14 @@ static int fld_cache_shrink(struct fld_cache *cache) struct list_head *curr; int num = 0; ENTRY; - + LASSERT(cache != NULL); if (cache->fci_cache_count < cache->fci_cache_size) RETURN(0); curr = cache->fci_lru.prev; - + while (cache->fci_cache_count + cache->fci_threshold > cache->fci_cache_size && curr != &cache->fci_lru) { @@ -196,7 +196,7 @@ static int fld_cache_shrink(struct fld_cache *cache) num++; } - CDEBUG(D_INFO|D_WARNING, "%s: FLD cache - Shrinked by " + CDEBUG(D_INFO, "%s: FLD cache - Shrinked by " "%d entries\n", cache->fci_name, num); RETURN(0); @@ -235,7 +235,7 @@ int fld_cache_insert(struct fld_cache *cache, if (!flde) RETURN(-ENOMEM); - /* + /* * Check if cache has the entry with such a seq again. It could be added * while we were allocating new entry. */ @@ -256,7 +256,7 @@ int fld_cache_insert(struct fld_cache *cache, hlist_add_head(&flde->fce_list, bucket); list_add(&flde->fce_lru, &cache->fci_lru); cache->fci_cache_count++; - + spin_unlock(&cache->fci_lock); RETURN(0); diff --git a/lustre/fld/fld_handler.c b/lustre/fld/fld_handler.c index 7fafc6e..29538f1 100644 --- a/lustre/fld/fld_handler.c +++ b/lustre/fld/fld_handler.c @@ -83,9 +83,6 @@ cfs_proc_dir_entry_t *fld_type_proc_dir = NULL; static int __init fld_mod_init(void) { - printk(KERN_INFO "Lustre: Fid Location Database; " - "info@clusterfs.com\n"); - fld_type_proc_dir = lprocfs_register(LUSTRE_FLD_NAME, proc_lustre_root, NULL, NULL); diff --git a/lustre/fld/fld_request.c b/lustre/fld/fld_request.c index b2fd751..849d536 100644 --- a/lustre/fld/fld_request.c +++ b/lustre/fld/fld_request.c @@ -84,12 +84,12 @@ fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq) const char *exp_name = target->ft_exp != NULL ? (char *)target->ft_exp->exp_obd->obd_uuid.uuid : ""; - + CERROR(" exp: 0x%p (%s), srv: 0x%p (%s), idx: "LPU64"\n", target->ft_exp, exp_name, target->ft_srv, srv_name, target->ft_idx); } - + /* * If target is not found, there is logical error anyway, so here is * LBUG() to catch this situation. @@ -171,7 +171,7 @@ int fld_client_add_target(struct lu_client_fld *fld, tar->ft_idx); RETURN(0); } else { - CDEBUG(D_INFO|D_WARNING, "%s: Adding target %s (idx " + CDEBUG(D_INFO, "%s: Adding target %s (idx " LPU64")\n", fld->lcf_name, name, tar->ft_idx); } @@ -345,8 +345,7 @@ out: if (rc) fld_client_fini(fld); else - CDEBUG(D_INFO|D_WARNING, - "%s: Using \"%s\" hash\n", + CDEBUG(D_INFO, "%s: Using \"%s\" hash\n", fld->lcf_name, fld->lcf_hash->fh_name); return rc; } @@ -452,7 +451,7 @@ int fld_client_create(struct lu_client_fld *fld, CDEBUG(D_INFO, "%s: Create fld entry (seq: "LPX64"; mds: " LPU64") on target %s (idx "LPU64")\n", fld->lcf_name, seq, mds, fld_target_name(target), target->ft_idx); - + #ifdef __KERNEL__ if (target->ft_srv != NULL) { LASSERT(env != NULL); @@ -478,7 +477,7 @@ int fld_client_create(struct lu_client_fld *fld, CERROR("%s: Can't create FLD entry, rc %d\n", fld->lcf_name, rc); } - + RETURN(rc); } EXPORT_SYMBOL(fld_client_create); @@ -500,7 +499,7 @@ int fld_client_delete(struct lu_client_fld *fld, seqno_t seq, CDEBUG(D_INFO, "%s: Delete fld entry (seq: "LPX64") on " "target %s (idx "LPU64")\n", fld->lcf_name, seq, fld_target_name(target), target->ft_idx); - + #ifdef __KERNEL__ if (target->ft_srv != NULL) { LASSERT(env != NULL); diff --git a/lustre/fld/lproc_fld.c b/lustre/fld/lproc_fld.c index 83737bc..c0dfba2 100644 --- a/lustre/fld/lproc_fld.c +++ b/lustre/fld/lproc_fld.c @@ -107,7 +107,7 @@ fld_proc_write_hash(struct file *file, const char *buffer, for (i = 0; fld_hash[i].fh_name != NULL; i++) { if (count != strlen(fld_hash[i].fh_name)) continue; - + if (!strncmp(fld_hash[i].fh_name, buffer, count)) { hash = &fld_hash[i]; break; @@ -119,7 +119,7 @@ fld_proc_write_hash(struct file *file, const char *buffer, fld->lcf_hash = hash; spin_unlock(&fld->lcf_lock); - CDEBUG(D_WARNING, "%s: Changed hash to \"%s\"\n", + CDEBUG(D_INFO, "%s: Changed hash to \"%s\"\n", fld->lcf_name, hash->fh_name); } @@ -136,9 +136,8 @@ fld_proc_write_cache_flush(struct file *file, const char *buffer, LASSERT(fld != NULL); fld_cache_flush(fld->lcf_cache); - - CDEBUG(D_WARNING, "%s: Lookup cache is flushed\n", - fld->lcf_name); + + CDEBUG(D_INFO, "%s: Lookup cache is flushed\n", fld->lcf_name); RETURN(count); } diff --git a/lustre/llite/super.c b/lustre/llite/super.c index 77cc526..b2e110d 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -63,8 +63,6 @@ static int __init init_lustre_lite(void) { int rc, seed[2]; - printk(KERN_INFO "Lustre: Lustre Client File System; " - "info@clusterfs.com\n"); ll_file_data_slab = kmem_cache_create("ll_file_data", sizeof(struct ll_file_data), 0, SLAB_HWCACHE_ALIGN, NULL, NULL); diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c index ddf5b8f..c98ef97 100644 --- a/lustre/llite/super25.c +++ b/lustre/llite/super25.c @@ -104,8 +104,6 @@ static int __init init_lustre_lite(void) { int rc, seed[2]; - printk(KERN_INFO "Lustre: Lustre Client File System; " - "info@clusterfs.com\n"); rc = ll_init_inodecache(); if (rc) return -ENOMEM; @@ -144,13 +142,13 @@ static int __init init_lustre_lite(void) proc_mkdir("llite", proc_lustre_root) : NULL; ll_register_cache(&ll_cache_definition); - + lustre_register_client_fill_super(ll_fill_super); lustre_register_client_process_config(ll_process_config); - + get_random_bytes(seed, sizeof(seed)); ll_srand(seed[0], seed[1]); - + init_timer(&ll_capa_timer); ll_capa_timer.function = ll_capa_timer_callback; rc = ll_capa_thread_start(); diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 5afbfd9..f67c6b2 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -73,7 +73,7 @@ static struct lu_device *mdd_device_fini(const struct lu_env *env, struct mdd_device *mdd = lu2mdd_dev(d); struct lu_device *next = &mdd->mdd_child->dd_lu_dev; int rc; - + rc = mdd_procfs_fini(mdd); if (rc) { CERROR("proc fini error %d \n", rc); @@ -471,7 +471,6 @@ LPROCFS_INIT_VARS(mdd, lprocfs_mdd_module_vars, lprocfs_mdd_obd_vars); static int __init mdd_mod_init(void) { struct lprocfs_static_vars lvars; - printk(KERN_INFO "Lustre: MetaData Device; info@clusterfs.com\n"); lprocfs_init_vars(mdd, &lvars); return class_register_type(&mdd_obd_device_ops, NULL, lvars.module_vars, LUSTRE_MDD_NAME, &mdd_device_type); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 67df8f3..50b4515 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -2069,7 +2069,7 @@ static int mdt_recovery(struct mdt_thread_info *info) if (recovering) { int rc; int should_process; - DEBUG_REQ(D_WARNING, req, "Got new replay"); + DEBUG_REQ(D_INFO, req, "Got new replay"); rc = mds_filter_recovery_request(req, obd, &should_process); if (rc != 0 || !should_process) RETURN(rc); @@ -4316,8 +4316,6 @@ static int __init mdt_mod_init(void) struct lprocfs_static_vars lvars; int rc; - printk(KERN_INFO "Lustre: MetaData Target; info@clusterfs.com\n"); - mdt_num_threads = MDT_NUM_THREADS; lprocfs_init_vars(mdt, &lvars); rc = class_register_type(&mdt_obd_device_ops, NULL, diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 10a30f2..a701b05 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -25,7 +25,7 @@ #define DEBUG_SUBSYSTEM S_MGMT -#define D_MOUNT D_SUPER|D_CONFIG /*|D_WARNING */ +#define D_MOUNT D_SUPER|D_CONFIG /*|D_WARNING */ #define PRINT_CMD LCONSOLE #define PRINT_MASK D_SUPER @@ -239,7 +239,7 @@ int server_put_mount_2(const char *name, struct vfsmount *mnt) static void ldd_print(struct lustre_disk_data *ldd) { - PRINT_CMD(PRINT_MASK, " disk data:\n"); + PRINT_CMD(PRINT_MASK, " disk data:\n"); PRINT_CMD(PRINT_MASK, "server: %s\n", ldd->ldd_svname); PRINT_CMD(PRINT_MASK, "uuid: %s\n", (char *)ldd->ldd_uuid); PRINT_CMD(PRINT_MASK, "fs: %s\n", ldd->ldd_fsname); @@ -308,8 +308,6 @@ static int ldd_parse(struct lvfs_run_ctxt *mount_ctxt, GOTO(out_close, rc = -EINVAL); } - ldd_print(ldd); - out_close: filp_close(file, 0); out: @@ -387,21 +385,21 @@ int lustre_process_log(struct super_block *sb, char *logname, rc = obd_process_config(mgc, sizeof(*lcfg), lcfg); lustre_cfg_free(lcfg); - if (rc == -EINVAL) + if (rc == -EINVAL) LCONSOLE_ERROR("%s: The configuration '%s' could not be read " "from the MGS (%d). Make sure this client and " "the MGS are running compatible versions of " "Lustre.\n", mgc->obd_name, logname, rc); - if (rc) + if (rc) { LCONSOLE_ERROR("%s: The configuration '%s' could not be read " "from the MGS (%d). This may be the result of " "communication errors between this node and " "the MGS, or the MGS may not be running.\n", mgc->obd_name, logname, rc); - - class_obd_list(); + class_obd_list(); + } RETURN(rc); } @@ -555,7 +553,7 @@ static int lustre_start_mgc(struct super_block *sb) ENTRY; LASSERT(lsi->lsi_lmd); - + /* Find the first non-lo MGS nid for our MGC name */ if (lsi->lsi_flags & LSI_SERVER) { ptr = lsi->lsi_ldd->ldd_params; @@ -566,7 +564,7 @@ static int lustre_start_mgc(struct super_block *sb) } else if (IS_MGS(lsi->lsi_ldd)) { lnet_process_id_t id; while ((rc = LNetGetId(i++, &id)) != -ENOENT) { - if (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND) + if (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND) continue; nid = id.nid; i++; @@ -576,7 +574,7 @@ static int lustre_start_mgc(struct super_block *sb) } else { /* client */ /* Use nids from mount line: uml1,1@elan:uml2,2@elan:/lustre */ ptr = lsi->lsi_lmd->lmd_dev; - if (class_parse_nid(ptr, &nid, &ptr) == 0) + if (class_parse_nid(ptr, &nid, &ptr) == 0) i++; } if (i == 0) { @@ -587,7 +585,7 @@ static int lustre_start_mgc(struct super_block *sb) len = strlen(LUSTRE_MGC_OBDNAME) + strlen(libcfs_nid2str(nid)) + 1; OBD_ALLOC(mgcname, len); OBD_ALLOC(niduuid, len + 2); - if (!mgcname || !niduuid) + if (!mgcname || !niduuid) GOTO(out_free, rc = -ENOMEM); sprintf(mgcname, "%s%s", LUSTRE_MGC_OBDNAME, libcfs_nid2str(nid)); @@ -651,7 +649,7 @@ static int lustre_start_mgc(struct super_block *sb) LCFG_ADD_UUID, niduuid, 0,0,0); i++; /* Stop at the first failover nid */ - if (*ptr == ':') + if (*ptr == ':') break; } } @@ -667,13 +665,13 @@ static int lustre_start_mgc(struct super_block *sb) class_uuid_unparse(uuidc, uuid); /* Start the MGC */ - rc = lustre_start_simple(mgcname, LUSTRE_MGC_NAME, + rc = lustre_start_simple(mgcname, LUSTRE_MGC_NAME, (char *)uuid->uuid, LUSTRE_MGS_OBDNAME, niduuid); OBD_FREE_PTR(uuid); - if (rc) + if (rc) GOTO(out_free, rc); - + /* Add any failover MGS nids */ i = 1; while ((*ptr == ':' || @@ -698,7 +696,7 @@ static int lustre_start_mgc(struct super_block *sb) } } lsi->lsi_lmd->lmd_mgs_failnodes = i; - + obd = class_name2obd(mgcname); if (!obd) { CERROR("Can't find mgcobd %s\n", mgcname); @@ -735,9 +733,9 @@ out: out_free: mutex_up(&mgc_start_lock); - if (mgcname) + if (mgcname) OBD_FREE(mgcname, len); - if (niduuid) + if (niduuid) OBD_FREE(niduuid, len + 2); RETURN(rc); } @@ -763,7 +761,7 @@ static int lustre_stop_mgc(struct super_block *sb) will call in here. */ CDEBUG(D_MOUNT, "mgc still has %d references.\n", atomic_read(&obd->u.cli.cl_mgc_refcount)); - GOTO(out, rc = -EBUSY); + GOTO(out, rc = -EBUSY); } /* MGC must always stop */ @@ -776,7 +774,7 @@ static int lustre_stop_mgc(struct super_block *sb) if (obd->u.cli.cl_mgc_mgsexp) obd_disconnect(obd->u.cli.cl_mgc_mgsexp); - /* Save the obdname for cleaning the nid uuids, which are + /* Save the obdname for cleaning the nid uuids, which are obdnameXX */ len = strlen(obd->obd_name) + 5; OBD_ALLOC(niduuid, len); @@ -786,15 +784,15 @@ static int lustre_stop_mgc(struct super_block *sb) } rc = class_manual_cleanup(obd); - if (rc) + if (rc) GOTO(out, rc); /* Clean the nid uuids */ - if (!niduuid) + if (!niduuid) RETURN(-ENOMEM); for (i = 0; i < lsi->lsi_lmd->lmd_mgs_failnodes; i++) { sprintf(ptr, "%x", i); - rc = do_lcfg(LUSTRE_MGC_OBDNAME, 0, LCFG_DEL_UUID, + rc = do_lcfg(LUSTRE_MGC_OBDNAME, 0, LCFG_DEL_UUID, niduuid, 0, 0, 0); if (rc) CERROR("del MDC UUID %s failed: rc = %d\n", @@ -802,7 +800,7 @@ static int lustre_stop_mgc(struct super_block *sb) } OBD_FREE(niduuid, len); /* class_import_put will get rid of the additional connections */ - + out: mutex_up(&mgc_start_lock); RETURN(rc); @@ -856,7 +854,7 @@ static int server_stop_servers(int lddflags, int lsiflags) /* Either an MDT or an OST or neither */ /* if this was an MDT, and there are no more MDT's, clean up the MDS */ - if ((lddflags & LDD_F_SV_TYPE_MDT) && + if ((lddflags & LDD_F_SV_TYPE_MDT) && (obd = class_name2obd(LUSTRE_MDS_OBDNAME))) { /*FIXME pre-rename, should eventually be LUSTRE_MDT_NAME*/ type = class_search_type(LUSTRE_MDS_NAME); @@ -1068,7 +1066,7 @@ int server_register_target(struct super_block *sb) label = fsfilt_get_label(mgc, lsi->lsi_srv_mnt->mnt_sb); if (label) CDEBUG(D_MOUNT, "Disk label changed to %s\n", label); - + /* Flush the new ldd to disk */ fsfilt_sync(mgc, lsi->lsi_srv_mnt->mnt_sb); } @@ -1097,9 +1095,9 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt) mutex_down(&server_start_lock); obd = class_name2obd(LUSTRE_MDS_OBDNAME); if (!obd) { - rc = lustre_start_simple(LUSTRE_MDS_OBDNAME, + rc = lustre_start_simple(LUSTRE_MDS_OBDNAME, /* FIXME pre-rename, should eventually be LUSTRE_MDS_NAME */ - LUSTRE_MDT_NAME, + LUSTRE_MDT_NAME, LUSTRE_MDS_OBDNAME"_uuid", 0, 0); if (rc) { @@ -1116,9 +1114,9 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt) obd = class_name2obd(LUSTRE_MDS_OBDNAME); if (!obd) { // FIXME pre-rename, should eventually be LUSTRE_MDS_NAME - rc = lustre_start_simple(LUSTRE_MDS_OBDNAME, + rc = lustre_start_simple(LUSTRE_MDS_OBDNAME, LUSTRE_MDS_NAME, - LUSTRE_MDS_OBDNAME"_uuid", + LUSTRE_MDS_OBDNAME"_uuid", 0, 0); if (rc) { CERROR("failed to start MDS: %d\n", rc); @@ -1134,9 +1132,9 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt) mutex_down(&server_start_lock); obd = class_name2obd(LUSTRE_OSS_OBDNAME); if (!obd) { - rc = lustre_start_simple(LUSTRE_OSS_OBDNAME, + rc = lustre_start_simple(LUSTRE_OSS_OBDNAME, LUSTRE_OSS_NAME, - LUSTRE_OSS_OBDNAME"_uuid", + LUSTRE_OSS_OBDNAME"_uuid", 0, 0); if (rc) { mutex_up(&server_start_lock); @@ -1175,7 +1173,7 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt) /* Let the target look up the mount using the target's name (we can't pass the sb or mnt through class_process_config.) */ rc = server_register_mount(lsi->lsi_ldd->ldd_svname, sb, mnt); - if (rc) + if (rc) GOTO(out_mgc, rc); /* Start targets using the llog named for the target */ @@ -1201,11 +1199,11 @@ out_mgc: if ((lsi->lsi_lmd->lmd_flags & LMD_FLG_ABORT_RECOV) && (OBP(obd, iocontrol))) { - obd_iocontrol(OBD_IOC_ABORT_RECOVERY, + obd_iocontrol(OBD_IOC_ABORT_RECOVERY, obd->obd_self_export, 0, NULL, NULL); } } - + RETURN(rc); } @@ -1283,8 +1281,8 @@ static int lustre_free_lsi(struct super_block *sb) RETURN(0); } - -/* The lsi has one reference for every server that is using the disk - + +/* The lsi has one reference for every server that is using the disk - e.g. MDT, MGS, and potentially MGC */ static int lustre_put_lsi(struct super_block *sb) { @@ -1407,7 +1405,7 @@ static void server_wait_finished(struct vfsmount *mnt) wait_queue_head_t waitq; struct l_wait_info lwi; int retries = 120; - + init_waitqueue_head(&waitq); while ((atomic_read(&mnt->mnt_count) > 1) && (retries > 0)) { @@ -1482,18 +1480,18 @@ static void server_put_super(struct super_block *sb) /* Clean the mgc and sb */ rc = lustre_common_put_super(sb); - /* FIXME how can I report a failure to umount? */ + /* FIXME how can I report a failure to umount? */ /* Wait for the targets to really clean up - can't exit (and let the sb get destroyed) while the mount is still in use */ server_wait_finished(mnt); - + /* drop the One True Mount */ unlock_mntput(mnt); #ifndef LUSTRE_PATCHLESS lvfs_clear_rdonly(save_dev); #endif - + /* Stop the servers (MDS, OSS) if no longer needed. We must wait until the target is really gone so that our type refcount check is right. */ @@ -1501,7 +1499,8 @@ static void server_put_super(struct super_block *sb) LCONSOLE_WARN("server umount %s complete\n", tmpname); OBD_FREE(tmpname, tmpname_sz); - class_obd_list(); + if (rc != 0) + class_obd_list(); EXIT; } @@ -1624,7 +1623,7 @@ static int server_fill_super(struct super_block *sb) /* start MGS before MGC */ if (IS_MGS(lsi->lsi_ldd)) { rc = server_start_mgs(sb); - if (rc) + if (rc) GOTO(out_mnt, rc); } @@ -1672,7 +1671,7 @@ int server_name2index(char *svname, __u32 *idx, char **endptr) unsigned long index; int rc; char *dash = strchr(svname, '-'); - if (!dash) + if (!dash) return(-EINVAL); if (strncmp(dash + 1, "MDT", 3) == 0) @@ -1696,7 +1695,7 @@ int lustre_common_put_super(struct super_block *sb) ENTRY; CDEBUG(D_MOUNT, "dropping sb %p\n", sb); - + /* Drop a ref to the MGC */ rc = lustre_stop_mgc(sb); if (rc && (rc != -ENOENT)) { @@ -1744,7 +1743,7 @@ int lustre_check_exclusion(struct super_block *sb, char *svname) ENTRY; rc = server_name2index(svname, &index, NULL); - if (rc != LDD_F_SV_TYPE_OST) + if (rc != LDD_F_SV_TYPE_OST) /* Only exclude OSTs */ RETURN(0); @@ -1767,9 +1766,9 @@ static int lmd_make_exclusion(struct lustre_mount_data *lmd, char *ptr) __u32 index, *exclude_list; int rc = 0, devmax; ENTRY; - + /* The shortest an ost name can be is 8 chars: -OST0000. - We don't actually know the fsname at this time, so in fact + We don't actually know the fsname at this time, so in fact a user could specify any fsname. */ devmax = strlen(ptr) / 8 + 1; @@ -1811,7 +1810,7 @@ static int lmd_make_exclusion(struct lustre_mount_data *lmd, char *ptr) lmd->lmd_exclude_count = 0; } } - OBD_FREE(exclude_list, sizeof(index) * devmax); + OBD_FREE(exclude_list, sizeof(index) * devmax); RETURN(rc); } @@ -1910,7 +1909,7 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) /* Client options are parsed in ll_options: eg. flock, user_xattr, acl */ - + /* Parse non-ldiskfs options here. Rather than modifying ldiskfs, we just zero these out here */ if (strncmp(s1, "abort_recov", 11) == 0) { @@ -1953,12 +1952,12 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) /* Find next opt */ s2 = strchr(s1, ','); if (s2 == NULL) { - if (clear) + if (clear) *s1 = '\0'; break; } s2++; - if (clear) + if (clear) memmove(s1, s2, strlen(s2) + 1); else s1 = s2; @@ -2002,7 +2001,6 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) lmd->lmd_magic = LMD_MAGIC; - lmd_print(lmd); RETURN(rc); invalid: @@ -2059,7 +2057,7 @@ static int lustre_fill_super(struct super_block *sb, void *data, int silent) out: if (rc){ - CERROR("Unable to mount %s (%d)\n", + CERROR("Unable to mount %s (%d)\n", s2lsi(sb) ? lmd->lmd_dev : "", rc); } else { LCONSOLE_WARN("mount %s complete\n", lmd->lmd_dev); @@ -2094,7 +2092,7 @@ int lustre_get_sb(struct file_system_type *fs_type, struct vfsmount *mnt) { /* calls back in fill super */ - /* we could append devname= onto options (*data) here, + /* we could append devname= onto options (*data) here, but 2.4 doesn't get devname. So we do it in mount_lustre.c */ return get_sb_nodev(fs_type, flags, data, lustre_fill_super, mnt); } diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 8441532..1c33a4a 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -2261,7 +2261,7 @@ static int filter_cleanup(struct obd_device *obd) /* Stop recovery before namespace cleanup. */ target_stop_recovery_thread(obd); target_cleanup_recovery(obd); - + ldlm_namespace_free(obd->obd_namespace, obd->obd_force); if (obd->u.obt.obt_sb == NULL) @@ -3907,8 +3907,6 @@ static int __init obdfilter_init(void) struct lprocfs_static_vars lvars; int rc; - printk(KERN_INFO "Lustre: Filtering OBD driver; info@clusterfs.com\n"); - lprocfs_init_vars(filter, &lvars); request_module("lquota"); -- 1.8.3.1