From 405054cf61ca2c05f20710e30fb51928879da148 Mon Sep 17 00:00:00 2001 From: nikita Date: Wed, 10 May 2006 23:46:21 +0000 Subject: [PATCH] libcfs: fixes to CDEBUG(), LASSERT() and friends to reduce stack consumption --- .../kernel_patches/series/ldiskfs-2.6-rhel4.series | 2 +- lustre/include/linux/lustre_net.h | 8 +++ .../kernel_patches/series/ldiskfs-2.6-rhel4.series | 2 +- lustre/ldlm/ldlm_lib.c | 16 ++--- lustre/ldlm/ldlm_lock.c | 20 +++--- lustre/ldlm/ldlm_resource.c | 10 +-- lustre/llite/llite_lib.c | 61 +++++++++--------- lustre/lov/lov_pack.c | 28 ++++----- lustre/lvfs/lvfs_linux.c | 2 +- lustre/mds/mds_fs.c | 8 +-- lustre/mds/mds_join.c | 6 +- lustre/mds/mds_open.c | 10 +-- lustre/mds/mds_reint.c | 8 +-- lustre/mgs/mgs_handler.c | 8 +-- lustre/obdclass/debug.c | 2 +- lustre/obdfilter/filter.c | 10 +-- lustre/obdfilter/filter_io.c | 4 +- lustre/obdfilter/filter_io_26.c | 6 +- lustre/ptlrpc/events.c | 72 +++++++++++----------- lustre/ptlrpc/pinger.c | 2 +- lustre/quota/quota_context.c | 28 ++++----- lustre/quota/quota_interface.c | 26 ++++---- lustre/tests/checkstack.pl | 4 +- 23 files changed, 178 insertions(+), 165 deletions(-) diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series index 9f7b49b..3934e40 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel4.series @@ -17,4 +17,4 @@ ext3-htree-path-ops.patch ext3-hash-selection.patch ext3-htree-comments.patch ext3-iam-ops.patch -ext3-iam-separate.patch +ext3-iam-separate.patch diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index 89bb2fe..60a3cec 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -432,6 +432,14 @@ do { \ __DEBUG_REQ(CDEBUG, level, req, fmt, ## args); \ } while (0) +#define DEBUG_REQ_EX(level, req, fmt, args...) \ +do { \ + if ((level) & (D_ERROR | D_WARNING)) \ + __DEBUG_REQ(CDEBUG_LIMIT, D_ERROR, req, fmt, ## args); \ + else \ + __DEBUG_REQ(CDEBUG_EX, level, req, fmt, ## args); \ +} while (0) + struct ptlrpc_bulk_page { struct list_head bp_link; int bp_buflen; diff --git a/lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series b/lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series index 9f7b49b..3934e40 100644 --- a/lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series +++ b/lustre/kernel_patches/series/ldiskfs-2.6-rhel4.series @@ -17,4 +17,4 @@ ext3-htree-path-ops.patch ext3-hash-selection.patch ext3-htree-comments.patch ext3-iam-ops.patch -ext3-iam-separate.patch +ext3-iam-separate.patch diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 072efe0..03da517 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -381,7 +381,7 @@ int client_connect_import(struct lustre_handle *dlm_handle, /* zero out sequence to check it later for validness */ ocd->ocd_seq = 0; - + rc = ptlrpc_connect_import(imp, NULL); if (rc != 0) { LASSERT (imp->imp_state == LUSTRE_IMP_DISCON); @@ -1428,7 +1428,7 @@ int target_handle_dqacq_callback(struct ptlrpc_request *req) struct qunit_data *qdata, *rep; int rc = 0, repsize = sizeof(struct qunit_data); ENTRY; - + rc = lustre_pack_reply(req, 1, &repsize, NULL); if (rc) { CERROR("packing reply failed!: rc = %d\n", rc); @@ -1436,7 +1436,7 @@ int target_handle_dqacq_callback(struct ptlrpc_request *req) } rep = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*rep)); LASSERT(rep); - + qdata = lustre_swab_reqbuf(req, 0, sizeof(*qdata), lustre_swab_qdata); if (qdata == NULL) { CERROR("unpacking request buffer failed!"); @@ -1447,19 +1447,19 @@ int target_handle_dqacq_callback(struct ptlrpc_request *req) LASSERT(obd->obd_observer && obd->obd_observer->obd_observer); master_obd = obd->obd_observer->obd_observer; qctxt = &master_obd->u.obt.obt_qctxt; - + LASSERT(qctxt->lqc_handler); rc = qctxt->lqc_handler(master_obd, qdata, req->rq_reqmsg->opc); if (rc && rc != -EDQUOT) - CDEBUG(rc == -EBUSY ? D_QUOTA : D_ERROR, + CDEBUG_EX(rc == -EBUSY ? D_QUOTA : D_ERROR, "dqacq failed! (rc:%d)\n", rc); - + /* the qd_count might be changed in lqc_handler */ memcpy(rep, qdata, sizeof(*rep)); req->rq_status = rc; rc = ptlrpc_reply(req); - - RETURN(rc); + + RETURN(rc); #else return 0; #endif /* !__KERNEL__ */ diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 02d2a29..cce090a 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -1230,48 +1230,48 @@ void ldlm_lock_dump(int level, struct ldlm_lock *lock, int pos) return; if (!lock) { - CDEBUG(level, " NULL LDLM lock\n"); + CDEBUG_EX(level, " NULL LDLM lock\n"); return; } - CDEBUG(level," -- Lock dump: %p/"LPX64" (rc: %d) (pos: %d) (pid: %d)\n", + CDEBUG_EX(level," -- Lock dump: %p/"LPX64" (rc: %d) (pos: %d) (pid: %d)\n", lock, lock->l_handle.h_cookie, atomic_read(&lock->l_refc), pos, lock->l_pid); if (lock->l_conn_export != NULL) obd = lock->l_conn_export->exp_obd; if (lock->l_export && lock->l_export->exp_connection) { - CDEBUG(level, " Node: NID %s (rhandle: "LPX64")\n", + CDEBUG_EX(level, " Node: NID %s (rhandle: "LPX64")\n", libcfs_nid2str(lock->l_export->exp_connection->c_peer.nid), lock->l_remote_handle.cookie); } else if (obd == NULL) { - CDEBUG(level, " Node: local\n"); + CDEBUG_EX(level, " Node: local\n"); } else { struct obd_import *imp = obd->u.cli.cl_import; - CDEBUG(level, " Node: NID %s (rhandle: "LPX64")\n", + CDEBUG_EX(level, " Node: NID %s (rhandle: "LPX64")\n", libcfs_nid2str(imp->imp_connection->c_peer.nid), lock->l_remote_handle.cookie); } - CDEBUG(level, " Resource: %p ("LPU64"/"LPU64")\n", lock->l_resource, + CDEBUG_EX(level, " Resource: %p ("LPU64"/"LPU64")\n", lock->l_resource, lock->l_resource->lr_name.name[0], lock->l_resource->lr_name.name[1]); - CDEBUG(level, " Req mode: %s, grant mode: %s, rc: %u, read: %d, " + CDEBUG_EX(level, " Req mode: %s, grant mode: %s, rc: %u, read: %d, " "write: %d flags: %#x\n", ldlm_lockname[lock->l_req_mode], ldlm_lockname[lock->l_granted_mode], atomic_read(&lock->l_refc), lock->l_readers, lock->l_writers, lock->l_flags); if (lock->l_resource->lr_type == LDLM_EXTENT) - CDEBUG(level, " Extent: "LPU64" -> "LPU64 + CDEBUG_EX(level, " Extent: "LPU64" -> "LPU64 " (req "LPU64"-"LPU64")\n", lock->l_policy_data.l_extent.start, lock->l_policy_data.l_extent.end, lock->l_req_extent.start, lock->l_req_extent.end); else if (lock->l_resource->lr_type == LDLM_FLOCK) - CDEBUG(level, " Pid: %d Extent: "LPU64" -> "LPU64"\n", + CDEBUG_EX(level, " Pid: %d Extent: "LPU64" -> "LPU64"\n", lock->l_policy_data.l_flock.pid, lock->l_policy_data.l_flock.start, lock->l_policy_data.l_flock.end); else if (lock->l_resource->lr_type == LDLM_IBITS) - CDEBUG(level, " Bits: "LPX64"\n", + CDEBUG_EX(level, " Bits: "LPX64"\n", lock->l_policy_data.l_inodebits.bits); } diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 19bd0e5..e2e8fa9 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -710,7 +710,7 @@ void ldlm_namespace_dump(int level, struct ldlm_namespace *ns) { struct list_head *tmp; - CDEBUG(level, "--- Namespace: %s (rc: %d, client: %d)\n", ns->ns_name, + CDEBUG_EX(level, "--- Namespace: %s (rc: %d, client: %d)\n", ns->ns_name, atomic_read(&ns->ns_refcount), ns->ns_client); l_lock(&ns->ns_lock); @@ -736,14 +736,14 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res) if (RES_NAME_SIZE != 4) LBUG(); - CDEBUG(level, "--- Resource: %p ("LPU64"/"LPU64"/"LPU64"/"LPU64 + CDEBUG_EX(level, "--- Resource: %p ("LPU64"/"LPU64"/"LPU64"/"LPU64 ") (rc: %d)\n", res, res->lr_name.name[0], res->lr_name.name[1], res->lr_name.name[2], res->lr_name.name[3], atomic_read(&res->lr_refcount)); if (!list_empty(&res->lr_granted)) { pos = 0; - CDEBUG(level, "Granted locks:\n"); + CDEBUG_EX(level, "Granted locks:\n"); list_for_each(tmp, &res->lr_granted) { struct ldlm_lock *lock; lock = list_entry(tmp, struct ldlm_lock, l_res_link); @@ -752,7 +752,7 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res) } if (!list_empty(&res->lr_converting)) { pos = 0; - CDEBUG(level, "Converting locks:\n"); + CDEBUG_EX(level, "Converting locks:\n"); list_for_each(tmp, &res->lr_converting) { struct ldlm_lock *lock; lock = list_entry(tmp, struct ldlm_lock, l_res_link); @@ -761,7 +761,7 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res) } if (!list_empty(&res->lr_waiting)) { pos = 0; - CDEBUG(level, "Waiting locks:\n"); + CDEBUG_EX(level, "Waiting locks:\n"); list_for_each(tmp, &res->lr_waiting) { struct ldlm_lock *lock; lock = list_entry(tmp, struct ldlm_lock, l_res_link); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index ca20686..69058a9 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -219,7 +219,7 @@ int client_common_fill_super(struct super_block *sb, char *mdc, char *osc) if ((sbi->ll_flags & LL_SBI_USER_XATTR) && !(data->ocd_connect_flags & OBD_CONNECT_XATTR)) { LCONSOLE_INFO("Disabling user_xattr feature because " - "it is not supported on the server\n"); + "it is not supported on the server\n"); sbi->ll_flags &= ~LL_SBI_USER_XATTR; } @@ -379,11 +379,11 @@ int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize) *lmmsize = obd_size_diskmd(sbi->ll_dt_exp, NULL); size = sizeof(int); - rc = obd_get_info(sbi->ll_md_exp, strlen("max_easize"), "max_easize", + rc = obd_get_info(sbi->ll_md_exp, strlen("max_easize"), "max_easize", &size, lmmsize); - if (rc) + if (rc) CERROR("Get max mdsize error rc %d \n", rc); - + RETURN(rc); } @@ -603,13 +603,13 @@ void ll_options(char *options, int *flags) next: /* Find next opt */ s2 = strchr(s1, ','); - if (s2 == NULL) + if (s2 == NULL) break; s1 = s2 + 1; } EXIT; } - + void ll_lli_init(struct ll_inode_info *lli) { sema_init(&lli->lli_open_sem, 1); @@ -634,18 +634,18 @@ int ll_fill_super(struct super_block *sb) char ll_instance[sizeof(sb) * 2 + 1]; int err; ENTRY; - + CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb); /* client additional sb info */ lsi->lsi_llsbi = sbi = ll_init_sbi(); - if (!sbi) + if (!sbi) RETURN(-ENOMEM); ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags); - + /* Generate a string unique to this super, in case some joker tries - to mount the same fs at two mount points. + to mount the same fs at two mount points. Use the address of the super itself.*/ sprintf(ll_instance, "%p", sb); cfg.cfg_instance = ll_instance; @@ -664,24 +664,24 @@ int ll_fill_super(struct super_block *sb) CERROR("No profile found: %s\n", profilenm); GOTO(out_free, err = -EINVAL); } - CDEBUG(D_CONFIG, "Found profile %s: mdc=%s osc=%s\n", profilenm, + CDEBUG(D_CONFIG, "Found profile %s: mdc=%s osc=%s\n", profilenm, lprof->lp_mdc, lprof->lp_osc); OBD_ALLOC(osc, strlen(lprof->lp_osc) + strlen(ll_instance) + 2); - if (!osc) + if (!osc) GOTO(out_free, err = -ENOMEM); sprintf(osc, "%s-%s", lprof->lp_osc, ll_instance); OBD_ALLOC(mdc, strlen(lprof->lp_mdc) + strlen(ll_instance) + 2); - if (!mdc) + if (!mdc) GOTO(out_free, err = -ENOMEM); sprintf(mdc, "%s-%s", lprof->lp_mdc, ll_instance); - + /* connections, registrations, sb setup */ err = client_common_fill_super(sb, mdc, osc); - + out_free: if (mdc) OBD_FREE(mdc, strlen(mdc) + 1); @@ -692,10 +692,10 @@ out_free: int next = 0; /* like ll_put_super below */ lustre_end_log(sb, NULL, &cfg); - while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next)) + while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next)) != NULL) { class_manual_cleanup(obd); - } + } class_del_profile(profilenm); ll_free_sbi(sb); lsi->lsi_llsbi = NULL; @@ -717,30 +717,30 @@ void ll_put_super(struct super_block *sb) ENTRY; CDEBUG(D_VFSTRACE, "VFS Op: sb %p - %s\n", sb, profilenm); - + sprintf(ll_instance, "%p", sb); cfg.cfg_instance = ll_instance; lustre_end_log(sb, NULL, &cfg); - + obd = class_exp2obd(sbi->ll_md_exp); if (obd) { int next = 0; int force = obd->obd_no_recov; - /* We need to set force before the lov_disconnect in + /* We need to set force before the lov_disconnect in lustre_common_put_super, since l_d cleans up osc's as well. */ - while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next)) + while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next)) != NULL) { obd->obd_force = force; - } + } } client_common_put_super(sb); - + while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next)) !=NULL) { class_manual_cleanup(obd); - } - - if (profilenm) + } + + if (profilenm) class_del_profile(profilenm); ll_free_sbi(sb); @@ -788,10 +788,15 @@ struct inode *ll_inode_from_lock(struct ldlm_lock *lock) inode = igrab(lock->l_ast_data); } else { inode = lock->l_ast_data; - __LDLM_DEBUG(inode->i_state & I_FREEING ? - D_INFO : D_WARNING, lock, + if (inode->i_state & I_FREEING) + __LDLM_DEBUG(D_INFO, lock, "l_ast_data %p is bogus: magic %08x", lock->l_ast_data, lli->lli_inode_magic); + else + __LDLM_DEBUG(D_WARNING, lock, + "l_ast_data %p is bogus: magic %08x", + lock->l_ast_data, lli->lli_inode_magic); + inode = NULL; } } diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index 40af0cb..f33e24b 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -42,15 +42,15 @@ void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm) struct lov_ost_data_v1 *lod; int i; - CDEBUG(level, "objid "LPX64", magic 0x%08X, pattern %#X\n", + CDEBUG_EX(level, "objid "LPX64", magic 0x%08X, pattern %#X\n", le64_to_cpu(lmm->lmm_object_id), le32_to_cpu(lmm->lmm_magic), le32_to_cpu(lmm->lmm_pattern)); - CDEBUG(level,"stripe_size %u, stripe_count %u\n", + CDEBUG_EX(level,"stripe_size %u, stripe_count %u\n", le32_to_cpu(lmm->lmm_stripe_size), le32_to_cpu(lmm->lmm_stripe_count)); for (i = 0, lod = lmm->lmm_objects; i < le32_to_cpu(lmm->lmm_stripe_count); i++, lod++) - CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n", + CDEBUG_EX(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n", i, le32_to_cpu(lod->l_ost_idx), le64_to_cpu(lod->l_object_gr), le64_to_cpu(lod->l_object_id)); @@ -59,13 +59,13 @@ void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm) void lov_dump_lmm_join(int level, struct lov_mds_md_join *lmmj) { - CDEBUG(level, "objid "LPX64", magic 0x%08X, pattern %#X\n", - le64_to_cpu(lmmj->lmmj_md.lmm_object_id), + CDEBUG_EX(level, "objid "LPX64", magic 0x%08X, pattern %#X\n", + le64_to_cpu(lmmj->lmmj_md.lmm_object_id), le32_to_cpu(lmmj->lmmj_md.lmm_magic), le32_to_cpu(lmmj->lmmj_md.lmm_pattern)); - CDEBUG(level,"stripe_size %u, stripe_count %u extent_count %u \n", + CDEBUG_EX(level,"stripe_size %u, stripe_count %u extent_count %u \n", le32_to_cpu(lmmj->lmmj_md.lmm_stripe_size), - le32_to_cpu(lmmj->lmmj_md.lmm_stripe_count), + le32_to_cpu(lmmj->lmmj_md.lmm_stripe_count), le32_to_cpu(lmmj->lmmj_extent_count)); } @@ -181,7 +181,7 @@ static int lov_verify_lmm(void *lmm, int lmm_bytes, int *stripe_count) return rc; } -int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count, +int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count, int pattern, int magic) { int lsm_size = lov_stripe_md_size(stripe_count); @@ -189,7 +189,7 @@ int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count, int i; ENTRY; - CDEBUG(D_INFO, "alloc lsm, stripe_count %d, lsm_size %d\n", + CDEBUG(D_INFO, "alloc lsm, stripe_count %d, lsm_size %d\n", stripe_count, lsm_size); OBD_ALLOC(*lsmp, lsm_size); @@ -206,7 +206,7 @@ int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count, (*lsmp)->lsm_xfersize = PTLRPC_MAX_BRW_SIZE * stripe_count; (*lsmp)->lsm_pattern = pattern; (*lsmp)->lsm_oinfo[0].loi_ost_idx = ~0; - + for (i = 0, loi = (*lsmp)->lsm_oinfo; i < stripe_count; i++, loi++) loi_init(loi); @@ -216,10 +216,10 @@ int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count, void lov_free_memmd(struct lov_stripe_md **lsmp) { struct lov_stripe_md *lsm = *lsmp; - + LASSERT(lsm_op_find(lsm->lsm_magic) != NULL); lsm_op_find(lsm->lsm_magic)->lsm_free(lsm); - + *lsmp = NULL; } @@ -227,7 +227,7 @@ void lov_free_memmd(struct lov_stripe_md **lsmp) /* Unpack LOV object metadata from disk storage. It is packed in LE byte * order and is opaque to the networking layer. */ -int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp, +int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp, struct lov_mds_md *lmm, int lmm_bytes) { struct obd_device *obd = class_exp2obd(exp); @@ -258,7 +258,7 @@ int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp, RETURN(0); } - lsm_size = lov_alloc_memmd(lsmp, stripe_count, LOV_PATTERN_RAID0, + lsm_size = lov_alloc_memmd(lsmp, stripe_count, LOV_PATTERN_RAID0, magic); if (lsm_size < 0) RETURN(lsm_size); diff --git a/lustre/lvfs/lvfs_linux.c b/lustre/lvfs/lvfs_linux.c index 7648df1..69c3616 100644 --- a/lustre/lvfs/lvfs_linux.c +++ b/lustre/lvfs/lvfs_linux.c @@ -502,7 +502,7 @@ static void __exit lvfs_linux_exit(void) ENTRY; leaked = atomic_read(&obd_memory); - CDEBUG(leaked ? D_ERROR : D_INFO, + CDEBUG_EX(leaked ? D_ERROR : D_INFO, "obd mem max: %d leaked: %d\n", obd_memmax, leaked); return; diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 1f4d463..72af624 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -173,7 +173,7 @@ int mds_client_free(struct obd_export *exp) sizeof(zero_mcd), &off, 1); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); - CDEBUG(rc == 0 ? D_INFO : D_ERROR, + CDEBUG_EX(rc == 0 ? D_INFO : D_ERROR, "zeroing out client %s idx %u in %s rc %d\n", med->med_mcd->mcd_uuid, med->med_lr_idx, LAST_RCVD, rc); } @@ -279,13 +279,13 @@ static int mds_init_server_data(struct obd_device *obd, struct file *file) CDEBUG(D_WARNING, "using old last_rcvd format\n"); lsd->lsd_mount_count = lsd->lsd_last_transno; lsd->lsd_last_transno = lsd->lsd_unused; - /* If we update the last_rcvd, we can never go back to + /* If we update the last_rcvd, we can never go back to an old install, so leave this in the old format for now. lsd->lsd_feature_incompat |= cpu_to_le32(LR_INCOMPAT_COMMON_LR); */ } lsd->lsd_feature_compat = cpu_to_le32(OBD_COMPAT_MDT); - + mds->mds_last_transno = le64_to_cpu(lsd->lsd_last_transno); CDEBUG(D_INODE, "%s: server last_transno: "LPU64"\n", @@ -549,7 +549,7 @@ err_pop: return rc; err_health_check: - if (mds->mds_health_check_filp && + if (mds->mds_health_check_filp && filp_close(mds->mds_health_check_filp, 0)) CERROR("can't close %s after error\n", HEALTH_CHECK); err_lov_objid: diff --git a/lustre/mds/mds_join.c b/lustre/mds/mds_join.c index ec06360..5075bfb 100644 --- a/lustre/mds/mds_join.c +++ b/lustre/mds/mds_join.c @@ -221,7 +221,7 @@ static void mds_finish_join(struct mds_obd *mds, struct ptlrpc_request *req, CDEBUG(D_INFO, "change the max md size from %d to %d \n", mds->mds_max_mdsize, sizeof(*lmmj)); - if (mds->mds_max_mdsize < max_easize || + if (mds->mds_max_mdsize < max_easize || mds->mds_max_cookiesize < max_cookiesize) { body->max_mdsize = mds->mds_max_mdsize > max_easize ? mds->mds_max_mdsize : max_easize; @@ -393,8 +393,8 @@ int mds_join_file(struct mds_update_record *rec, struct ptlrpc_request *req, if (rc < 0) GOTO(cleanup, rc); - LASSERTF(le32_to_cpu(head_lmm->lmm_magic) == LOV_MAGIC_JOIN || - le32_to_cpu(head_lmm->lmm_magic) == LOV_MAGIC); + LASSERT(le32_to_cpu(head_lmm->lmm_magic) == LOV_MAGIC_JOIN || + le32_to_cpu(head_lmm->lmm_magic) == LOV_MAGIC); push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); ctxt = llog_get_context(obd, LLOG_LOVEA_ORIG_CTXT); diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 27f5a9c..f70a487 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -414,7 +414,7 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, int level = D_ERROR; if (rc == -ENOSPC) level = D_INODE; - CDEBUG(level, "error creating objects for " + CDEBUG_EX(level, "error creating objects for " "inode %lu: rc = %d\n", inode->i_ino, rc); if (rc > 0) { @@ -691,14 +691,14 @@ static int mds_finish_open(struct ptlrpc_request *req, struct dentry *dchild, UNLOCK_INODE_MUTEX(dchild->d_inode); RETURN(-EEXIST); } - if (rec->ur_flags & MDS_OPEN_JOIN_FILE) { + if (rec->ur_flags & MDS_OPEN_JOIN_FILE) { UNLOCK_INODE_MUTEX(dchild->d_inode); - rc = mds_join_file(rec, req, dchild, lockh); + rc = mds_join_file(rec, req, dchild, lockh); if (rc) RETURN(rc); LOCK_INODE_MUTEX(dchild->d_inode); - } - if (!(body->valid & OBD_MD_FLEASIZE) && + } + if (!(body->valid & OBD_MD_FLEASIZE) && !(body->valid & OBD_MD_FLMODEASIZE)) { /* no EA: create objects */ rc = mds_create_objects(req, 2, rec, mds, obd, diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 76a0c46..3905d1f 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -182,9 +182,9 @@ int mds_finish_transno(struct mds_obd *mds, struct inode *inode, void *handle, rc = err; } - DEBUG_REQ(log_pri, req, - "wrote trans #"LPU64" rc %d client %s at idx %u: err = %d", - transno, rc, mcd->mcd_uuid, med->med_lr_idx, err); + DEBUG_REQ_EX(log_pri, req, + "wrote trans #"LPU64" rc %d client %s at idx %u: err = %d", + transno, rc, mcd->mcd_uuid, med->med_lr_idx, err); err = mds_lov_write_objids(obd); if (err) { @@ -192,7 +192,7 @@ int mds_finish_transno(struct mds_obd *mds, struct inode *inode, void *handle, if (rc == 0) rc = err; } - CDEBUG(log_pri, "wrote objids: err = %d\n", err); + CDEBUG_EX(log_pri, "wrote objids: err = %d\n", err); commit: err = fsfilt_commit(obd, inode, handle, 0); diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 10ef4b33..671529d 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -260,7 +260,7 @@ static int mgs_cleanup(struct obd_device *obd) RETURN(0); save_dev = lvfs_sbdev(mgs->mgs_sb); - + ptlrpc_unregister_service(mgs->mgs_service); lprocfs_obd_cleanup(obd); @@ -272,8 +272,8 @@ static int mgs_cleanup(struct obd_device *obd) server_put_mount(obd->obd_name, mgs->mgs_vfsmnt); mgs->mgs_sb = NULL; - /* Free the namespace in it's own thread, so that if the - ldlm_cancel_handler put the last mgs obd ref, we won't + /* Free the namespace in it's own thread, so that if the + ldlm_cancel_handler put the last mgs obd ref, we won't deadlock here. */ kernel_thread(mgs_ldlm_nsfree, obd->obd_namespace, CLONE_VM | CLONE_FS); @@ -541,7 +541,7 @@ int mgs_handle(struct ptlrpc_request *req) LASSERT(current->journal_info == NULL); - CDEBUG(D_CONFIG | (rc?D_ERROR:0), "MGS handle cmd=%d rc=%d\n", + CDEBUG_EX(D_CONFIG | (rc?D_ERROR:0), "MGS handle cmd=%d rc=%d\n", req->rq_reqmsg->opc, rc); out: diff --git a/lustre/obdclass/debug.c b/lustre/obdclass/debug.c index 4024823..90c57e1 100644 --- a/lustre/obdclass/debug.c +++ b/lustre/obdclass/debug.c @@ -102,7 +102,7 @@ int dump_obdo(struct obdo *oa) void dump_lsm(int level, struct lov_stripe_md *lsm) { - CDEBUG(level, "lsm %p, objid "LPX64", maxbytes "LPX64", magic 0x%08X, " + CDEBUG_EX(level, "lsm %p, objid "LPX64", maxbytes "LPX64", magic 0x%08X, " "stripe_size %u, stripe_count %u\n", lsm, lsm->lsm_object_id, lsm->lsm_maxbytes, lsm->lsm_magic, lsm->lsm_stripe_size, lsm->lsm_stripe_count); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index e27227b..3521135 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -126,7 +126,7 @@ int filter_finish_transno(struct obd_export *exp, struct obd_trans_info *oti, rc = err; } - CDEBUG(log_pri, "wrote trans "LPU64" for client %s at #%d: err = %d\n", + CDEBUG_EX(log_pri, "wrote trans "LPU64" for client %s at #%d: err = %d\n", last_rcvd, fcd->fcd_uuid, fed->fed_lr_idx, err); RETURN(rc); @@ -281,7 +281,7 @@ static int filter_client_free(struct obd_export *exp) filter->fo_fsd, 1); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); - CDEBUG(rc == 0 ? D_INFO : D_ERROR, + CDEBUG_EX(rc == 0 ? D_INFO : D_ERROR, "zeroing out client %s at idx %u (%llu) in %s rc %d\n", fed->fed_fcd->fcd_uuid, fed->fed_lr_idx, fed->fed_lr_off, LAST_RCVD, rc); @@ -1513,7 +1513,7 @@ int filter_common_setup(struct obd_device *obd, struct lustre_cfg* lcfg, } else { str = "no UUID"; } - + label = fsfilt_get_label(obd, obd->u.obt.obt_sb); if (obd->obd_recovering) { @@ -2242,7 +2242,7 @@ out_unlock: unsigned int cur_ids[MAXQUOTAS] = {oa->o_uid, oa->o_gid}; int rc2 = lquota_adjust(quota_interface, exp->exp_obd, cur_ids, orig_ids, rc, FSFILT_OP_SETATTR); - CDEBUG(rc2 ? D_ERROR : D_QUOTA, + CDEBUG_EX(rc2 ? D_ERROR : D_QUOTA, "filter adjust qunit. (rc:%d)\n", rc2); } return rc; @@ -2830,7 +2830,7 @@ cleanup: qcids[GRPQUOTA] = oa->o_gid; rc2 = lquota_adjust(quota_interface, obd, qcids, NULL, rc, FSFILT_OP_UNLINK); - CDEBUG(rc2 ? D_ERROR : D_QUOTA, + CDEBUG_EX(rc2 ? D_ERROR : D_QUOTA, "filter adjust qunit! (rc:%d)\n", rc2); return rc; } diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index c8c1b6b..cf7140d 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -107,7 +107,7 @@ static void filter_grant_incoming(struct obd_export *exp, struct obdo *oa) /* Add some margin, since there is a small race if other RPCs arrive * out-or-order and have already consumed some grant. We want to * leave this here in case there is a large error in accounting. */ - CDEBUG(oa->o_grant > fed->fed_grant + FILTER_GRANT_CHUNK ? mask:D_CACHE, + CDEBUG_EX(oa->o_grant > fed->fed_grant + FILTER_GRANT_CHUNK ? mask:D_CACHE, "%s: cli %s/%p reports grant: "LPU64" dropped: %u, local: %lu\n", obd->obd_name, exp->exp_client_uuid.uuid, exp, oa->o_grant, oa->o_dropped, fed->fed_grant); @@ -458,7 +458,7 @@ static int filter_grant_check(struct obd_export *exp, int objcount, fed->fed_pending += used; exp->exp_obd->u.filter.fo_tot_pending += used; - CDEBUG(mask, + CDEBUG_EX(mask, "%s: cli %s/%p used: %lu ungranted: %lu grant: %lu dirty: %lu\n", exp->exp_obd->obd_name, exp->exp_client_uuid.uuid, exp, used, ungranted, fed->fed_grant, fed->fed_dirty); diff --git a/lustre/obdfilter/filter_io_26.c b/lustre/obdfilter/filter_io_26.c index b5e2664..1bd4995 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -600,7 +600,7 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, if (IS_ERR(oti->oti_handle)) { UNLOCK_INODE_MUTEX(inode); rc = PTR_ERR(oti->oti_handle); - CDEBUG(rc == -ENOSPC ? D_INODE : D_ERROR, + CDEBUG_EX(rc == -ENOSPC ? D_INODE : D_ERROR, "error starting transaction: rc = %d\n", rc); oti->oti_handle = NULL; GOTO(cleanup, rc); @@ -682,8 +682,8 @@ cleanup: qcids[USRQUOTA] = oa->o_uid; qcids[GRPQUOTA] = oa->o_gid; err = lquota_adjust(quota_interface, obd, qcids, NULL, rc, - FSFILT_OP_CREATE); - CDEBUG(err ? D_ERROR : D_QUOTA, + FSFILT_OP_CREATE); + CDEBUG_EX(err ? D_ERROR : D_QUOTA, "error filter adjust qunit! (rc:%d)\n", err); RETURN(rc); diff --git a/lustre/ptlrpc/events.c b/lustre/ptlrpc/events.c index ab9e4f3..2222df9 100644 --- a/lustre/ptlrpc/events.c +++ b/lustre/ptlrpc/events.c @@ -36,7 +36,7 @@ lnet_handle_eq_t ptlrpc_eq_h; -/* +/* * Client's outgoing request callback */ void request_out_callback(lnet_event_t *ev) @@ -50,8 +50,8 @@ void request_out_callback(lnet_event_t *ev) ev->type == LNET_EVENT_UNLINK); LASSERT (ev->unlinked); - DEBUG_REQ((ev->status == 0) ? D_NET : D_ERROR, req, - "type %d, status %d", ev->type, ev->status); + DEBUG_REQ_EX((ev->status == 0) ? D_NET : D_ERROR, req, + "type %d, status %d", ev->type, ev->status); if (ev->type == LNET_EVENT_UNLINK || ev->status != 0) { @@ -88,9 +88,9 @@ void reply_in_callback(lnet_event_t *ev) LASSERT (ev->md.start == req->rq_repmsg); LASSERT (ev->offset == 0); LASSERT (ev->mlength <= req->rq_replen); - - DEBUG_REQ((ev->status == 0) ? D_NET : D_ERROR, req, - "type %d, status %d", ev->type, ev->status); + + DEBUG_REQ_EX((ev->status == 0) ? D_NET : D_ERROR, req, + "type %d, status %d", ev->type, ev->status); spin_lock_irqsave (&req->rq_lock, flags); @@ -110,7 +110,7 @@ void reply_in_callback(lnet_event_t *ev) EXIT; } -/* +/* * Client's bulk has been written/read */ void client_bulk_callback (lnet_event_t *ev) @@ -120,15 +120,15 @@ void client_bulk_callback (lnet_event_t *ev) unsigned long flags; ENTRY; - LASSERT ((desc->bd_type == BULK_PUT_SINK && + LASSERT ((desc->bd_type == BULK_PUT_SINK && ev->type == LNET_EVENT_PUT) || (desc->bd_type == BULK_GET_SOURCE && ev->type == LNET_EVENT_GET) || ev->type == LNET_EVENT_UNLINK); LASSERT (ev->unlinked); - CDEBUG((ev->status == 0) ? D_NET : D_ERROR, - "event type %d, status %d, desc %p\n", + CDEBUG_EX((ev->status == 0) ? D_NET : D_ERROR, + "event type %d, status %d, desc %p\n", ev->type, ev->status, desc); spin_lock_irqsave (&desc->bd_lock, flags); @@ -149,7 +149,7 @@ void client_bulk_callback (lnet_event_t *ev) EXIT; } -/* +/* * Server's incoming request callback */ void request_in_callback(lnet_event_t *ev) @@ -167,8 +167,8 @@ void request_in_callback(lnet_event_t *ev) LASSERT ((char *)ev->md.start + ev->offset + ev->mlength <= rqbd->rqbd_buffer + service->srv_buf_size); - CDEBUG((ev->status == 0) ? D_NET : D_ERROR, - "event type %d, status %d, service %s\n", + CDEBUG_EX((ev->status == 0) ? D_NET : D_ERROR, + "event type %d, status %d, service %s\n", ev->type, ev->status, service->srv_name); if (ev->unlinked) { @@ -189,7 +189,7 @@ void request_in_callback(lnet_event_t *ev) if (req == NULL) { CERROR("Can't allocate incoming request descriptor: " "Dropping %s RPC from %s\n", - service->srv_name, + service->srv_name, libcfs_id2str(ev->initiator)); return; } @@ -222,7 +222,7 @@ void request_in_callback(lnet_event_t *ev) service->srv_nrqbd_receiving == 0) { /* This service is off-air because all its request * buffers are busy. Portals will start dropping - * incoming requests until more buffers get posted. + * incoming requests until more buffers get posted. * NB don't moan if it's because we're tearing down the * service. */ CERROR("All %s request buffers busy\n", @@ -301,12 +301,12 @@ void server_bulk_callback (lnet_event_t *ev) (desc->bd_type == BULK_GET_SINK && ev->type == LNET_EVENT_REPLY)); - CDEBUG((ev->status == 0) ? D_NET : D_ERROR, - "event type %d, status %d, desc %p\n", + CDEBUG_EX((ev->status == 0) ? D_NET : D_ERROR, + "event type %d, status %d, desc %p\n", ev->type, ev->status, desc); spin_lock_irqsave (&desc->bd_lock, flags); - + if ((ev->type == LNET_EVENT_ACK || ev->type == LNET_EVENT_REPLY) && ev->status == 0) { @@ -340,11 +340,11 @@ static void ptlrpc_master_callback(lnet_event_t *ev) callback == request_in_callback || callback == reply_out_callback || callback == server_bulk_callback); - + callback (ev); } -int ptlrpc_uuid_to_peer (struct obd_uuid *uuid, +int ptlrpc_uuid_to_peer (struct obd_uuid *uuid, lnet_process_id_t *peer, lnet_nid_t *self) { int best_dist = 0; @@ -372,7 +372,7 @@ int ptlrpc_uuid_to_peer (struct obd_uuid *uuid, rc = 0; break; } - + LASSERT (order >= 0); if (rc < 0 || dist < best_dist || @@ -395,7 +395,7 @@ int ptlrpc_uuid_to_peer (struct obd_uuid *uuid, } CDEBUG(D_NET,"%s->%s\n", uuid->uuid, libcfs_id2str(*peer)); - if (rc != 0) + if (rc != 0) CERROR("No NID found for %s\n", uuid->uuid); return rc; } @@ -406,7 +406,7 @@ void ptlrpc_ni_fini(void) struct l_wait_info lwi; int rc; int retries; - + /* Wait for the event queue to become idle since there may still be * messages in flight with pending events (i.e. the fire-and-forget * messages == client requests and "non-difficult" server @@ -421,11 +421,11 @@ void ptlrpc_ni_fini(void) case 0: LNetNIFini(); return; - + case -EBUSY: if (retries != 0) CWARN("Event queue still busy\n"); - + /* Wait for a bit */ init_waitqueue_head(&waitq); lwi = LWI_TIMEOUT(2*HZ, NULL, NULL); @@ -447,7 +447,7 @@ lnet_pid_t ptl_get_pid(void) #endif return pid; } - + int ptlrpc_ni_init(void) { int rc; @@ -493,14 +493,14 @@ void * liblustre_register_wait_callback (int (*fn)(void *arg), void *arg) { struct liblustre_wait_callback *llwc; - + OBD_ALLOC(llwc, sizeof(*llwc)); LASSERT (llwc != NULL); - + llwc->llwc_fn = fn; llwc->llwc_arg = arg; list_add_tail(&llwc->llwc_list, &liblustre_wait_callbacks); - + return (llwc); } @@ -508,7 +508,7 @@ void liblustre_deregister_wait_callback (void *opaque) { struct liblustre_wait_callback *llwc = opaque; - + list_del(&llwc->llwc_list); OBD_FREE(llwc, sizeof(*llwc)); } @@ -524,16 +524,16 @@ liblustre_check_events (int timeout) rc = LNetEQPoll(&ptlrpc_eq_h, 1, timeout * 1000, &ev, &i); if (rc == 0) RETURN(0); - + LASSERT (rc == -EOVERFLOW || rc == 1); - + /* liblustre: no asynch callback so we can't affort to miss any * events... */ if (rc == -EOVERFLOW) { CERROR ("Dropped an event!!!\n"); abort(); } - + ptlrpc_master_callback (&ev); RETURN(1); } @@ -557,9 +557,9 @@ liblustre_wait_event (int timeout) /* Give all registered callbacks a bite at the cherry */ list_for_each(tmp, &liblustre_wait_callbacks) { - llwc = list_entry(tmp, struct liblustre_wait_callback, + llwc = list_entry(tmp, struct liblustre_wait_callback, llwc_list); - + if (llwc->llwc_fn(llwc->llwc_arg)) found_something = 1; } @@ -589,7 +589,7 @@ int ptlrpc_init_portals(void) return -EIO; } #ifndef __KERNEL__ - liblustre_services_callback = + liblustre_services_callback = liblustre_register_wait_callback(&liblustre_check_services, NULL); #endif return 0; diff --git a/lustre/ptlrpc/pinger.c b/lustre/ptlrpc/pinger.c index 159ef9b..cfdce8d 100644 --- a/lustre/ptlrpc/pinger.c +++ b/lustre/ptlrpc/pinger.c @@ -111,7 +111,7 @@ static int ptlrpc_pinger_main(void *arg) imp->imp_force_verify = 0; spin_unlock_irqrestore(&imp->imp_lock, flags); - CDEBUG(level == LUSTRE_IMP_FULL ? D_INFO : D_HA, + CDEBUG_EX(level == LUSTRE_IMP_FULL ? D_INFO : D_HA, "level %s/%u force %u deactive %u pingable %u\n", ptlrpc_import_state_name(level), level, force, imp->imp_deactive, imp->imp_pingable); diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index 5efb2a4..3aab55c 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -283,14 +283,14 @@ struct qunit_waiter { /* FIXME check if this mds is the master of specified id */ -static int -is_master(struct obd_device *obd, struct lustre_quota_ctxt *qctxt, +static int +is_master(struct obd_device *obd, struct lustre_quota_ctxt *qctxt, unsigned int id, int type) { return qctxt->lqc_handler ? 1 : 0; } -static int +static int schedule_dqacq(struct obd_device *obd, struct lustre_quota_ctxt *qctxt, struct qunit_data *qdata, int opc, int wait); @@ -402,7 +402,7 @@ out: * - local dqacq/dqrel. * - local disk io failure. */ - if (err || (rc && rc != -EBUSY) || + if (err || (rc && rc != -EBUSY) || is_master(obd, qctxt, qdata->qd_id, qdata->qd_type)) RETURN(err); @@ -480,18 +480,18 @@ schedule_dqacq(struct obd_device *obd, if ((empty = alloc_qunit(qctxt, qdata, opc)) == NULL) RETURN(-ENOMEM); - + spin_lock(&qunit_hash_lock); qunit = dqacq_in_flight(qctxt, qdata); if (qunit) { - if (wait) + if (wait) list_add_tail(&qw.qw_entry, &qunit->lq_waiters); spin_unlock(&qunit_hash_lock); - + free_qunit(empty); goto wait_completion; - } + } qunit = empty; insert_qunit_nolock(qctxt, qunit); if (wait) @@ -532,7 +532,7 @@ schedule_dqacq(struct obd_device *obd, req->rq_interpret_reply = dqacq_interpret; ptlrpcd_add_req(req); - QDATA_DEBUG(qdata, "%s scheduled.\n", + QDATA_DEBUG(qdata, "%s scheduled.\n", opc == QUOTA_DQACQ ? "DQACQ" : "DQREL"); wait_completion: if (wait && qunit) { @@ -581,7 +581,7 @@ qctxt_adjust_qunit(struct obd_device *obd, struct lustre_quota_ctxt *qctxt, RETURN(rc); } -int +int qctxt_wait_pending_dqacq(struct lustre_quota_ctxt *qctxt, unsigned int id, unsigned short type, int isblk) { @@ -656,7 +656,7 @@ void qctxt_cleanup(struct lustre_quota_ctxt *qctxt, int force) remove_qunit_nolock(qunit); /* wake up all waiters */ - list_for_each_entry_safe(qw, tmp2, &qunit->lq_waiters, + list_for_each_entry_safe(qw, tmp2, &qunit->lq_waiters, qw_entry) { list_del_init(&qw->qw_entry); qw->qw_rc = 0; @@ -685,7 +685,7 @@ static int qslave_recovery_main(void *arg) struct qslave_recov_thread_data *data = arg; struct obd_device *obd = data->obd; struct lustre_quota_ctxt *qctxt = data->qctxt; - unsigned int type; + unsigned int type; int rc = 0; ENTRY; @@ -743,7 +743,7 @@ static int qslave_recovery_main(void *arg) rc = 0; if (rc) - CDEBUG(rc == -EBUSY ? D_QUOTA : D_ERROR, + CDEBUG_EX(rc == -EBUSY ? D_QUOTA : D_ERROR, "qslave recovery failed! (id:%d type:%d " " rc:%d)\n", dqid->di_id, type, rc); free: @@ -755,7 +755,7 @@ free: RETURN(rc); } -void +void qslave_start_recovery(struct obd_device *obd, struct lustre_quota_ctxt *qctxt) { struct qslave_recov_thread_data data; diff --git a/lustre/quota/quota_interface.c b/lustre/quota/quota_interface.c index 6085ff3..5edd982 100644 --- a/lustre/quota/quota_interface.c +++ b/lustre/quota/quota_interface.c @@ -112,7 +112,7 @@ quota_parse_config_args(char *options, int *quotaon, int *type, bunit = option; break; case Opt_itune_ratio: - if (match_int(&args[0], &option) || + if (match_int(&args[0], &option) || option <= 0 || option >= 100) rc = -EINVAL; itune = option; @@ -163,7 +163,7 @@ quota_parse_config_args(char *options, int *quotaon, int *type, return rc; } -static int auto_quota_on(struct obd_device *obd, int type, +static int auto_quota_on(struct obd_device *obd, int type, struct super_block *sb, int is_master) { struct obd_quotactl *oqctl; @@ -195,7 +195,7 @@ static int auto_quota_on(struct obd_device *obd, int type, local_quota: /* turn on local quota */ rc = fsfilt_quotactl(obd, sb, oqctl); - CDEBUG(rc ? D_ERROR : D_INFO, "auto-enable quota. rc=%d\n", rc); + CDEBUG_EX(rc ? D_ERROR : D_INFO, "auto-enable quota. rc=%d\n", rc); if (rc && is_master) mds_quota_off(obd, oqctl); out_pop: @@ -313,16 +313,16 @@ static int filter_quota_getflag(struct obd_device *obd, struct obdo *oa) oa->o_valid |= (cnt == USRQUOTA) ? OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA; if (oqctl->qc_dqblk.dqb_bhardlimit && - (toqb(oqctl->qc_dqblk.dqb_curspace) > + (toqb(oqctl->qc_dqblk.dqb_curspace) > oqctl->qc_dqblk.dqb_bhardlimit)) - oa->o_flags |= (cnt == USRQUOTA) ? + oa->o_flags |= (cnt == USRQUOTA) ? OBD_FL_NO_USRQUOTA : OBD_FL_NO_GRPQUOTA; } OBD_FREE_PTR(oqctl); RETURN(rc); } -static int filter_quota_acquire(struct obd_device *obd, unsigned int uid, +static int filter_quota_acquire(struct obd_device *obd, unsigned int uid, unsigned int gid) { struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt; @@ -412,8 +412,8 @@ static struct list_head qinfo_hash[NR_DQHASH]; /* SLAB cache for client quota context */ kmem_cache_t *qinfo_cachep = NULL; -static inline int const hashfn(struct client_obd *cli, - unsigned long id, +static inline int const hashfn(struct client_obd *cli, + unsigned long id, int type) { unsigned long tmp = ((unsigned long)cli>>6) ^ id; @@ -424,7 +424,7 @@ static inline int const hashfn(struct client_obd *cli, /* caller must hold qinfo_list_lock */ static inline void insert_qinfo_hash(struct osc_quota_info *oqi) { - struct list_head *head = qinfo_hash + + struct list_head *head = qinfo_hash + hashfn(oqi->oqi_cli, oqi->oqi_id, oqi->oqi_type); LASSERT_SPIN_LOCKED(&qinfo_list_lock); @@ -477,7 +477,7 @@ static void free_qinfo(struct osc_quota_info *oqi) OBD_SLAB_FREE(oqi, qinfo_cachep, sizeof(*oqi)); } -int osc_quota_chkdq(struct client_obd *cli, +int osc_quota_chkdq(struct client_obd *cli, unsigned int uid, unsigned int gid) { unsigned int id; @@ -500,7 +500,7 @@ int osc_quota_chkdq(struct client_obd *cli, RETURN(rc); } -int osc_quota_setdq(struct client_obd *cli, +int osc_quota_setdq(struct client_obd *cli, unsigned int uid, unsigned int gid, obd_flag valid, obd_flag flags) { @@ -513,12 +513,12 @@ int osc_quota_setdq(struct client_obd *cli, for (cnt = 0; cnt < MAXQUOTAS; cnt++) { struct osc_quota_info *oqi, *old; - if (!(valid & ((cnt == USRQUOTA) ? + if (!(valid & ((cnt == USRQUOTA) ? OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA))) continue; id = (cnt == USRQUOTA) ? uid : gid; - noquota = (cnt == USRQUOTA) ? + noquota = (cnt == USRQUOTA) ? (flags & OBD_FL_NO_USRQUOTA) : (flags & OBD_FL_NO_GRPQUOTA); oqi = alloc_qinfo(cli, id, cnt); diff --git a/lustre/tests/checkstack.pl b/lustre/tests/checkstack.pl index 3504e96..c59c970 100644 --- a/lustre/tests/checkstack.pl +++ b/lustre/tests/checkstack.pl @@ -27,8 +27,8 @@ # use anything else and feel the pain ;) { my $arch = shift; - $x = "[0-9a-f]{3,5}"; # hex number >= 256 - $d = "([0-9]{2}|[2-9])[0-9]{2}"; # decimal number >= 200 + $x = "[0-9a-f]{1,5}"; # hex number + $d = "[0-9]{1,5}"; # decimal number if ($arch eq "") { $arch = `uname -m`; } -- 1.8.3.1