From 0c1ffedac3fb04718756f46d111d80b07f26102e Mon Sep 17 00:00:00 2001 From: nikita Date: Wed, 29 Nov 2006 19:09:12 +0000 Subject: [PATCH] remove obsolete debugging. --- lustre/cmm/cmm_split.c | 9 +- .../patches/ext3-pdirops-2.6.9.patch | 123 +++++---------------- lustre/mdd/mdd_dir.c | 13 --- lustre/mdd/mdd_object.c | 15 +-- lustre/mdt/mdt_reint.c | 7 -- lustre/osd/osd_handler.c | 10 -- 6 files changed, 33 insertions(+), 144 deletions(-) diff --git a/lustre/cmm/cmm_split.c b/lustre/cmm/cmm_split.c index 27c6027..a661282 100644 --- a/lustre/cmm/cmm_split.c +++ b/lustre/cmm/cmm_split.c @@ -61,7 +61,7 @@ int cmm_split_check(const struct lu_env *env, struct md_object *mp, ENTRY; cmm_lprocfs_time_start(cmm, &start, LPROC_CMM_SPLIT_CHECK); - + /* Not split yet */ if (clo->clo_split == CMM_SPLIT_NONE || clo->clo_split == CMM_SPLIT_DENIED) @@ -71,7 +71,7 @@ int cmm_split_check(const struct lu_env *env, struct md_object *mp, /* Try to get the LMV EA */ memset(ma, 0, sizeof(*ma)); - + ma->ma_need = MA_LMV; ma->ma_lmv_size = lmv_size; OBD_ALLOC(ma->ma_lmv, lmv_size); @@ -562,8 +562,6 @@ static int cmm_split_process_stripe(const struct lu_env *env, RETURN(rc); } -extern int bug11150; - static int cmm_split_process_dir(const struct lu_env *env, struct md_object *mo, struct md_attr *ma) @@ -603,7 +601,6 @@ static int cmm_split_process_dir(const struct lu_env *env, CERROR("Error (rc = %d) while splitting for %d: fid=" DFID", %08x:%08x\n", rc, i, PFID(lf), rdpg->rp_hash, hash_end); - bug11150 = 1; GOTO(cleanup, rc); } } @@ -625,7 +622,7 @@ int cmm_split_dir(const struct lu_env *env, struct md_object *mo) ENTRY; cmm_lprocfs_time_start(cmm, &start, LPROC_CMM_SPLIT); - + LASSERT(S_ISDIR(lu_object_attr(&mo->mo_lu))); memset(ma, 0, sizeof(*ma)); diff --git a/lustre/kernel_patches/patches/ext3-pdirops-2.6.9.patch b/lustre/kernel_patches/patches/ext3-pdirops-2.6.9.patch index 8c55d7b..2540d52 100644 --- a/lustre/kernel_patches/patches/ext3-pdirops-2.6.9.patch +++ b/lustre/kernel_patches/patches/ext3-pdirops-2.6.9.patch @@ -47,49 +47,7 @@ Index: iam/fs/ext3/namei.c static inline void dx_set_limit(struct iam_entry *entries, unsigned value) { ((struct dx_countlimit *) entries)->limit = cpu_to_le16(value); -@@ -116,6 +117,41 @@ int dx_index_is_compat(struct iam_path * - } - - -+static int dx_bug11027_check(struct iam_path *p, struct iam_frame *f) -+{ -+#if 0 -+ struct iam_entry *e; -+ struct iam_container *c; -+ unsigned count; -+ unsigned i; -+ iam_ptr_t blk; -+ iam_ptr_t root; -+ struct inode *inode; -+ -+ c = p->ip_container; -+ e = dx_node_get_entries(p, f); -+ count = dx_get_count(e); -+ e = iam_entry_shift(p, e, 1); -+ root = iam_path_descr(p)->id_ops->id_root_ptr(c); -+ -+ inode = iam_path_obj(p); -+ for (i = 0; i < count - 1; ++i, e = iam_entry_shift(p, e, 1)) { -+ iam_ikeycpy(c, iam_path_ikey(p, 0), iam_path_ikey(p, 1)); -+ iam_get_ikey(p, e, iam_path_ikey(p, 1)); -+ blk = dx_get_block(p, e); -+ /* -+ * By definition of a tree, no node points to the root. -+ */ -+ if (blk == root) { -+ dump_stack(); -+ BREAKPOINT(); -+ return 0; -+ } -+ } -+#endif -+ return 1; -+} -+ - int dx_node_check(struct iam_path *p, struct iam_frame *f) - { - struct iam_entry *e; -@@ -143,7 +179,10 @@ int dx_node_check(struct iam_path *p, st +@@ -143,7 +144,10 @@ int dx_node_check(struct iam_path *p, st return 0; } blk = dx_get_block(p, e); @@ -101,7 +59,7 @@ Index: iam/fs/ext3/namei.c BREAKPOINT(); return 0; } -@@ -241,12 +280,241 @@ struct stats dx_show_entries(struct dx_h +@@ -241,12 +245,241 @@ struct stats dx_show_entries(struct dx_h } #endif /* DX_DEBUG */ @@ -345,7 +303,7 @@ Index: iam/fs/ext3/namei.c struct iam_descr *param; struct iam_frame *frame; -@@ -255,20 +523,19 @@ int dx_lookup(struct iam_path *path) +@@ -255,20 +488,19 @@ int dx_lookup(struct iam_path *path) param = iam_path_descr(path); c = path->ip_container; @@ -376,7 +334,7 @@ Index: iam/fs/ext3/namei.c if (err != 0) break; -@@ -283,53 +550,83 @@ int dx_lookup(struct iam_path *path) +@@ -283,53 +515,82 @@ int dx_lookup(struct iam_path *path) break; assert_inv(dx_node_check(path, frame)); @@ -395,7 +353,6 @@ Index: iam/fs/ext3/namei.c - q = iam_entry_shift(path, m, -1); - else - p = iam_entry_shift(path, m, +1); -+ assert(dx_bug11027_check(path, frame)); + /* + * splitting may change root index block and move hash we're + * looking for into another index block so, we have to check @@ -498,7 +455,7 @@ Index: iam/fs/ext3/namei.c /* * Probe for a directory leaf block to search. * -@@ -339,7 +636,7 @@ int dx_lookup(struct iam_path *path) +@@ -339,7 +600,7 @@ int dx_lookup(struct iam_path *path) * check for this error code, and make sure it never gets reflected * back to userspace. */ @@ -507,7 +464,7 @@ Index: iam/fs/ext3/namei.c struct dx_hash_info *hinfo, struct iam_path *path) { int err; -@@ -347,7 +644,7 @@ static int dx_probe(struct dentry *dentr +@@ -347,7 +608,7 @@ static int dx_probe(struct dentry *dentr assert_corr(path->ip_data != NULL); ipc = container_of(path->ip_data, struct iam_path_compat, ipc_descr); @@ -516,7 +473,7 @@ Index: iam/fs/ext3/namei.c ipc->ipc_hinfo = hinfo; assert_corr(dx_index_is_compat(path)); -@@ -356,6 +653,7 @@ static int dx_probe(struct dentry *dentr +@@ -356,6 +617,7 @@ static int dx_probe(struct dentry *dentr return err; } @@ -524,7 +481,7 @@ Index: iam/fs/ext3/namei.c /* * This function increments the frame pointer to search the next leaf * block, and reads in the necessary intervening nodes if the search -@@ -391,10 +689,16 @@ static int ext3_htree_advance(struct ino +@@ -391,10 +653,16 @@ static int ext3_htree_advance(struct ino * nodes need to be read. */ while (1) { @@ -542,7 +499,7 @@ Index: iam/fs/ext3/namei.c if (p == path->ip_frames) return 0; num_frames++; -@@ -409,7 +713,7 @@ static int ext3_htree_advance(struct ino +@@ -409,7 +677,7 @@ static int ext3_htree_advance(struct ino * If the hash is 1, then continue only if the next page has a * continuation hash of any value. This is used for readdir * handling. Otherwise, check to see if the hash matches the @@ -551,7 +508,7 @@ Index: iam/fs/ext3/namei.c * there's no point to read in the successive index pages. */ iam_get_ikey(path, p->at, (struct iam_ikey *)&bhash); -@@ -425,25 +729,126 @@ static int ext3_htree_advance(struct ino +@@ -425,25 +693,125 @@ static int ext3_htree_advance(struct ino * block so no check is necessary */ while (num_frames--) { @@ -582,7 +539,6 @@ Index: iam/fs/ext3/namei.c + p->leaf = dx_get_block(path, p->at); + dx_unlock_bh(p->bh); assert_inv(dx_node_check(path, p)); -+ assert(dx_bug11027_check(path, p)); } return 1; } @@ -683,7 +639,7 @@ Index: iam/fs/ext3/namei.c } int ext3_htree_next_block(struct inode *dir, __u32 hash, -@@ -649,14 +1054,26 @@ void iam_insert_key(struct iam_path *pat +@@ -649,14 +1017,25 @@ void iam_insert_key(struct iam_path *pat struct iam_entry *new = iam_entry_shift(path, frame->at, +1); int count = dx_get_count(entries); @@ -698,7 +654,6 @@ Index: iam/fs/ext3/namei.c dx_set_block(path, new, ptr); dx_set_count(entries, count + 1); + assert_inv(dx_node_check(path, frame)); -+ assert(dx_bug11027_check(path, frame)); +} + +void iam_insert_key_lock(struct iam_path *path, struct iam_frame *frame, @@ -710,7 +665,7 @@ Index: iam/fs/ext3/namei.c } void dx_insert_block(struct iam_path *path, struct iam_frame *frame, -@@ -882,7 +1299,7 @@ static struct buffer_head * ext3_dx_find +@@ -882,7 +1261,7 @@ static struct buffer_head * ext3_dx_find sb = dir->i_sb; /* NFS may look up ".." - look at dx_root directory block */ if (namelen > 2 || name[0] != '.'||(name[1] != '.' && name[1] != '\0')){ @@ -719,7 +674,7 @@ Index: iam/fs/ext3/namei.c if (*err != 0) return NULL; } else { -@@ -1114,7 +1531,7 @@ struct ext3_dir_entry_2 *move_entries(st +@@ -1114,7 +1493,7 @@ struct ext3_dir_entry_2 *move_entries(st hash2 = map[split].hash; continued = hash2 == map[split - 1].hash; dxtrace(printk("Split block %i at %x, %i/%i\n", @@ -728,7 +683,7 @@ Index: iam/fs/ext3/namei.c /* Fancy dance to stay within two buffers */ de2 = dx_move_dirents(data1, data2, map + split, count - split); -@@ -1484,16 +1901,38 @@ static int shift_entries(struct iam_path +@@ -1484,16 +1863,38 @@ static int shift_entries(struct iam_path (char *) iam_entry_shift(path, entries, count1), count2 * iam_entry_size(path)); @@ -770,7 +725,7 @@ Index: iam/fs/ext3/namei.c { struct iam_entry *entries; /* old block contents */ -@@ -1501,6 +1940,8 @@ int split_index_node(handle_t *handle, s +@@ -1501,6 +1902,8 @@ int split_index_node(handle_t *handle, s struct iam_frame *frame, *safe; struct buffer_head *bh_new[DX_MAX_TREE_HEIGHT] = {0}; u32 newblock[DX_MAX_TREE_HEIGHT] = {0}; @@ -779,7 +734,7 @@ Index: iam/fs/ext3/namei.c struct inode *dir = iam_path_obj(path); struct iam_descr *descr; int nr_splet; -@@ -1523,12 +1964,14 @@ int split_index_node(handle_t *handle, s +@@ -1523,12 +1926,14 @@ int split_index_node(handle_t *handle, s * - first allocate all necessary blocks * * - insert pointers into them atomically. @@ -798,7 +753,7 @@ Index: iam/fs/ext3/namei.c dxtrace(printk("using %u of %u node entries\n", dx_get_count(entries), dx_get_limit(entries))); -@@ -1536,6 +1979,7 @@ int split_index_node(handle_t *handle, s +@@ -1536,6 +1941,7 @@ int split_index_node(handle_t *handle, s for (nr_splet = 0; frame >= path->ip_frames && dx_get_count(frame->entries) == dx_get_limit(frame->entries); --frame, ++nr_splet) { @@ -806,7 +761,7 @@ Index: iam/fs/ext3/namei.c if (nr_splet == DX_MAX_TREE_HEIGHT) { ext3_warning(dir->i_sb, __FUNCTION__, "Directory index full!\n"); -@@ -1545,14 +1989,53 @@ int split_index_node(handle_t *handle, s +@@ -1545,14 +1951,53 @@ int split_index_node(handle_t *handle, s } safe = frame; @@ -861,7 +816,7 @@ Index: iam/fs/ext3/namei.c BUFFER_TRACE(frame->bh, "get_write_access"); err = ext3_journal_get_write_access(handle, frame->bh); if (err) -@@ -1560,6 +2043,7 @@ int split_index_node(handle_t *handle, s +@@ -1560,6 +2005,7 @@ int split_index_node(handle_t *handle, s } /* Add "safe" node to transaction too */ if (safe + 1 != path->ip_frames) { @@ -869,7 +824,7 @@ Index: iam/fs/ext3/namei.c err = ext3_journal_get_write_access(handle, safe->bh); if (err) goto journal_error; -@@ -1596,16 +2080,21 @@ int split_index_node(handle_t *handle, s +@@ -1596,16 +2042,21 @@ int split_index_node(handle_t *handle, s assert_corr(i == 0); @@ -891,17 +846,7 @@ Index: iam/fs/ext3/namei.c /* Shift frames in the path */ memmove(frames + 2, frames + 1, (sizeof path->ip_frames) - 2 * sizeof frames[0]); -@@ -1613,18 +2102,22 @@ int split_index_node(handle_t *handle, s - frames[1].at = iam_entry_shift(path, entries2, idx); - frames[1].entries = entries = entries2; - frames[1].bh = bh2; -+ assert(dx_bug11027_check(path, frame)); - assert_inv(dx_node_check(path, frame)); - ++ path->ip_frame; - ++ frame; - assert_inv(dx_node_check(path, frame)); -+ assert(dx_bug11027_check(path, frame)); - bh_new[0] = NULL; /* buffer head is "consumed" */ +@@ -1621,10 +2072,12 @@ int split_index_node(handle_t *handle, s err = ext3_journal_get_write_access(handle, bh2); if (err) goto journal_error; @@ -914,7 +859,7 @@ Index: iam/fs/ext3/namei.c count = shift_entries(path, frame, count, entries, entries2, newblock[i]); /* Which index block gets the new entry? */ -@@ -1634,33 +2127,44 @@ int split_index_node(handle_t *handle, s +@@ -1634,7 +2087,11 @@ int split_index_node(handle_t *handle, s frame->at = iam_entry_shift(path, entries2, idx - count + d); frame->entries = entries = entries2; @@ -926,14 +871,7 @@ Index: iam/fs/ext3/namei.c bh_new[i] = bh2; parent->at = iam_entry_shift(path, parent->at, +1); - } - assert_inv(dx_node_check(path, frame)); - assert_inv(dx_node_check(path, parent)); -+ assert(dx_bug11027_check(path, frame)); -+ assert(dx_bug11027_check(path, parent)); - dxtrace(dx_show_index ("node", frame->entries)); - dxtrace(dx_show_index ("node", - ((struct dx_node *) bh2->b_data)->entries)); +@@ -1647,20 +2104,25 @@ int split_index_node(handle_t *handle, s err = ext3_journal_dirty_metadata(handle, bh2); if (err) goto journal_error; @@ -960,7 +898,7 @@ Index: iam/fs/ext3/namei.c if (nr_splet > 0) { /* * Log ->i_size modification. -@@ -1674,6 +2178,12 @@ journal_error: +@@ -1674,6 +2136,12 @@ journal_error: ext3_std_error(dir->i_sb, err); cleanup: @@ -973,7 +911,7 @@ Index: iam/fs/ext3/namei.c for (i = 0; i < ARRAY_SIZE(bh_new); ++i) { if (bh_new[i] != NULL) brelse(bh_new[i]); -@@ -1695,18 +2205,18 @@ static int ext3_dx_add_entry(handle_t *h +@@ -1695,18 +2163,18 @@ static int ext3_dx_add_entry(handle_t *h struct buffer_head * bh = NULL; struct inode *dir = dentry->d_parent->d_inode; struct ext3_dir_entry_2 *de; @@ -994,7 +932,7 @@ Index: iam/fs/ext3/namei.c isize = dir->i_size; err = param->id_ops->id_node_read(path->ip_container, -@@ -1726,7 +2236,7 @@ static int ext3_dx_add_entry(handle_t *h +@@ -1726,7 +2194,7 @@ static int ext3_dx_add_entry(handle_t *h goto cleanup; } @@ -1003,14 +941,7 @@ Index: iam/fs/ext3/namei.c if (err) goto cleanup; -@@ -1736,12 +2246,14 @@ static int ext3_dx_add_entry(handle_t *h - goto cleanup; - - assert_inv(dx_node_check(path, frame)); -+ assert(dx_bug11027_check(path, frame)); - err = add_dirent_to_buf(handle, dentry, inode, de, bh); - goto cleanup2; - +@@ -1742,6 +2210,7 @@ static int ext3_dx_add_entry(handle_t *h journal_error: ext3_std_error(dir->i_sb, err); cleanup: diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index ef3d5f9..de5b001 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -574,16 +574,6 @@ static int mdd_unlink(const struct lu_env *env, struct md_object *pobj, int rc, is_dir; ENTRY; - /* - * Check -ENOENT early here because we need to get object type - * to calculate credits before transaction start - */ - if (!lu_object_exists(&cobj->mo_lu)) { - LU_OBJECT_DEBUG(D_ERROR, env, &cobj->mo_lu, - "unlinking as `%s'", name); - RETURN(-ENOENT); - } - LASSERTF(lu_object_exists(&cobj->mo_lu) > 0, "FID is "DFID"\n", PFID(lu_object_fid(&cobj->mo_lu))); @@ -606,11 +596,8 @@ static int mdd_unlink(const struct lu_env *env, struct md_object *pobj, is_dir = S_ISDIR(lu_object_attr(&cobj->mo_lu)); - current->debugging1 |= 0x1; /* XXX enable lvar_enoent_debug - * debugging */ rc = __mdd_index_delete(env, mdd_pobj, name, is_dir, handle, mdd_object_capa(env, mdd_pobj)); - current->debugging1 &= ~0x1; if (rc) GOTO(cleanup, rc); diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index 831ce06..984a1b2 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -326,7 +326,7 @@ static int mdd_attr_get_internal(const struct lu_env *env, struct timeval start; int rc = 0; ENTRY; - + mdd_lprocfs_time_start(mdd, &start, LPROC_MDD_ATTR_GET); if (ma->ma_need & MA_INODE) rc = mdd_iattr_get(env, mdd_obj, ma); @@ -490,7 +490,7 @@ int mdd_attr_set_internal(const struct lu_env *env, struct mdd_object *o, if (!rc && (attr->la_valid & LA_MODE) && needacl) rc = mdd_acl_chmod(env, o, attr->la_mode, handle); #endif - mdd_lprocfs_time_end(mdd, &start, LPROC_MDD_ATTR_SET); + mdd_lprocfs_time_end(mdd, &start, LPROC_MDD_ATTR_SET); RETURN(rc); } @@ -1096,7 +1096,7 @@ static int mdd_ref_add(const struct lu_env *env, RETURN(rc); } -/* +/* * do NOT or the MAY_*'s, you'll get the weakest * XXX: Can NOT understand. */ @@ -1255,9 +1255,6 @@ static int mdd_readpage_sanity_check(const struct lu_env *env, RETURN(rc); } -int bug11150 = 0; -EXPORT_SYMBOL(bug11150); - static int mdd_dir_page_build(const struct lu_env *env, int first, void *area, int nob, struct dt_it_ops *iops, struct dt_it *it, __u32 *start, __u32 *end, @@ -1298,12 +1295,6 @@ static int mdd_dir_page_build(const struct lu_env *env, int first, CDEBUG(D_INFO, "%p %p %d "DFID": %#8.8x (%d) \"%*.*s\"\n", name, ent, nob, PFID(fid2), hash, len, len, len, name); - if (bug11150) - CDEBUG(D_INFO, - "%p %p %d "DFID": %#8.8x (%d) \"%*.*s\"\n", - name, ent, nob, PFID(fid2), hash, - len, len, len, name); - if (nob >= recsize) { fid_be_to_cpu(&ent->lde_fid, fid); fid_cpu_to_le(&ent->lde_fid, &ent->lde_fid); diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 18ebec8..a079a94 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -381,12 +381,6 @@ static int mdt_reint_unlink(struct mdt_thread_info *info, mdt_lprocfs_time_start(info->mti_mdt, &info->mti_time, LPROC_MDT_REINT_UNLINK); - /* - * XXX Enforce full debugging log for unlinks, to track buffalo - * -ENOENT error. - */ - current->debugging0 = ~0; - DEBUG_REQ(D_INODE, req, "unlink "DFID"/%s\n", PFID(rr->rr_fid1), rr->rr_name); @@ -477,7 +471,6 @@ out: mdt_shrink_reply(info, REPLY_REC_OFF + 1, 0, 0); mdt_lprocfs_time_end(info->mti_mdt, &info->mti_time, LPROC_MDT_REINT_UNLINK); - current->debugging0 = 0; return rc; } diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index a220bf9..c8e022a 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -449,16 +449,6 @@ static int osd_inode_remove(const struct lu_env *env, struct osd_object *obj) th = osd_trans_start(env, &osd->od_dt_dev, prm); if (!IS_ERR(th)) { result = osd_oi_delete(oti, &osd->od_oi, fid, th); - /* - * XXX chasing buffalo bug. - */ - if (result == -ENOENT) { - extern int lfix_dump; - - lfix_dump = 1; - osd_oi_delete(oti, &osd->od_oi, fid, th); - lfix_dump = 0; - } osd_trans_stop(env, th); } else result = PTR_ERR(th); -- 1.8.3.1