From 03c58fe89a0ec4643a7810a30a9f19ffc53e330e Mon Sep 17 00:00:00 2001 From: shadow Date: Fri, 22 Jun 2007 05:31:36 +0000 Subject: [PATCH] inode i_nlink equal zero is not enough for output message about disk corruption, i_ctime and i_mode should be also checked. b=10419 i=green i=kalpak --- lustre/ChangeLog | 8 +++++++- lustre/mds/handler.c | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 500133b..4c9f598 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -357,13 +357,19 @@ Frequency : always Description: fix mal-formatted messages Details : fix some mal-formatted DEBUG_REQ and LCONSOLE_ERROR_MSG messages - Severity : minor Bugzilla : 11737 Frequency : always in liblustre Description: wrong IS_ERR implementation in liblustre.h Details : fix IS_ERR implementation in liblustre.h for right detect errors. +Severity : minor +Bugzilla : 10419 +Frequency : always +Description: Correct condition for output debug message. +Details : inode i_nlink equal zero is not enough for output message about disk + corruption, i_ctime and i_mode should be also checked. + -------------------------------------------------------------------------------- 2007-05-03 Cluster File Systems, Inc. diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 503cb4e..1c4e05f 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -225,12 +225,18 @@ 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/%u, " - "link %lu, count %d)\n", inode->i_ino, - inode->i_generation,(unsigned long)inode->i_nlink, - atomic_read(&inode->i_count)); + if (inode->i_nlink == 0) { + if (inode->i_mode == 0 && + LTIME_S(inode->i_ctime) == 0 ) { + struct obd_device *obd = container_of(mds, struct + obd_device, u.mds); + LCONSOLE_WARN("Found inode with zero nlink, mode and " + "ctime -- this may indicate disk" + "corruption (device %s, inode %lu, link:" + " %lu, count: %d)\n", obd->obd_name, inode->i_ino, + (unsigned long)inode->i_nlink, + atomic_read(&inode->i_count)); + } dput(result); RETURN(ERR_PTR(-ENOENT)); } -- 1.8.3.1