From 8997fe5b825a9c3e43685e47e3e659a7b49d5cae Mon Sep 17 00:00:00 2001 From: adilger Date: Sat, 10 Sep 2005 06:31:36 +0000 Subject: [PATCH] Branch b1_4 Added debugging for bad LOV EA detection. Quiet spurious error for generation mismatch. r=phil (original patch) --- lustre/lov/lov_pack.c | 3 ++- lustre/mds/handler.c | 17 ++++++++++++++--- lustre/mds/mds_reint.c | 3 +-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index 049ea80..c85333d 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -211,8 +211,9 @@ static int lov_verify_lmm(void *lmm, int lmm_bytes, int *stripe_count) case LOV_MAGIC_V1: return lov_verify_lmm_v1(lmm, lmm_bytes, stripe_count); default: - CERROR("bad disk LOV MAGIC: 0x%08X\n", + CERROR("bad disk LOV MAGIC: 0x%08X; dumping V1 LMM:\n", le32_to_cpu(*(__u32 *)lmm)); + lov_dump_lmm_v1(D_WARNING, lmm); return -EINVAL; } } diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index e731846..0f90dd6 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -218,10 +218,21 @@ struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid, if (!inode) RETURN(ERR_PTR(-ENOENT)); + if (inode->i_generation == 0 || inode->i_nlink == 0) { + LCONSOLE_WARN("Found inode with zero generation or link -- this" + " may indicate disk corruption (inode: %lu, link:" + " %lu, count: %d)\n", inode->i_ino, + (unsigned long)inode->i_nlink, + atomic_read(&inode->i_count)); + dput(result); + RETURN(ERR_PTR(-ENOENT)); + } + if (generation && inode->i_generation != generation) { /* we didn't find the right inode.. */ - CERROR("bad inode %lu, link: %lu ct: %d or generation %u/%u\n", - inode->i_ino, (unsigned long)inode->i_nlink, + CDEBUG(D_INODE, "found wrong generation: inode %lu, link: %lu, " + "count: %d, generation %u/%u\n", inode->i_ino, + (unsigned long)inode->i_nlink, atomic_read(&inode->i_count), inode->i_generation, generation); dput(result); @@ -1591,7 +1602,7 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf) obd->obd_replayable ? "enabled" : "disabled"); } - ldlm_timeout = 6; + ldlm_timeout = 2; ping_evictor_start(); RETURN(0); diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 23f3e56..182836d 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -397,8 +397,7 @@ int mds_osc_setattr_async(struct obd_device *obd, struct inode *inode, rc = obd_unpackmd(mds->mds_osc_exp, &lsm, lmm, lmm_size); if (rc < 0) { - CERROR("Error unpack md %p for inode %lu\n", lmm, - inode->i_ino); + CERROR("Error unpack md %p for inode %lu\n", lmm, inode->i_ino); GOTO(out, rc); } -- 1.8.3.1