Skip to content

Commit

Permalink
b=910 MDS: error looking up logfile (debug patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
morrone committed May 4, 2010
1 parent bef7c49 commit f1452db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions lustre/include/lustre_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ static inline int llog_create(struct llog_ctxt *ctxt, struct llog_handle **res,
if (!raised)
cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
rc = lop->lop_create(ctxt, res, logid, name);
if (rc == -ENOENT) {
/* Bug 910: Since this is an inline function, we should
* get the name of the calling function here
* (expect llog_cat_id2handle for bug) */
CERROR("lop_create function returned ENOENT\n");
}
if (!raised)
cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
RETURN(rc);
Expand Down
16 changes: 13 additions & 3 deletions lustre/mds/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,19 @@ struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
/* under ext3 this is neither supposed to return bad inodes
nor NULL inodes. */
result = mds_lookup(obd, fid_name, mds->mds_fid_de, strlen(fid_name));
if (IS_ERR(result))
if (IS_ERR(result)) {
CERROR("mds_lookup() (fid_name %s ino/gen %lu/%u) returned %ld\n",
fid_name, ino, generation, PTR_ERR(result));
RETURN(result);
}

inode = result->d_inode;
if (!inode)
if (!inode) {
CERROR("mds_lookup() (fid_name %s ino/gen %lu/%u) "
"returned dentry with NULL inode\n",
fid_name, ino, generation);
RETURN(ERR_PTR(-ENOENT));
}

if (inode->i_nlink == 0) {
if (inode->i_mode == 0 &&
Expand All @@ -253,12 +260,15 @@ struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
atomic_read(&inode->i_count));
}
dput(result);
CERROR("mds_lookup() (fid_name %s ino/gen %lu/%u) "
"returned inode with no hard links\n",
fid_name, ino, generation);
RETURN(ERR_PTR(-ENOENT));
}

if (generation && inode->i_generation != generation) {
/* we didn't find the right inode.. */
CDEBUG(D_INODE, "found wrong generation: inode %lu, link: %lu, "
CERROR("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,
Expand Down

0 comments on commit f1452db

Please sign in to comment.